0
2つのグループ化された棒グラフを持つfacet_wrapプロットです。私は以下のテキストに質問とコードを添付しました。複数レベルのグループ化された棒グラフ
Q1:プロットに描かれたよう指定された位置でトリプルアスタリスクに注釈を付ける方法(より良い、それは私の計算/指定なしに自動的に位置を特定することができますか)?試したが動作しなかった:
ann_text1=data.frame(ligand=c(2), uptake=c(24), kd=factor("p", levels=c("p","q")))
tp=t+geom_text(data=ann_text1,label="***", size=8)
Q2:ストリップタイトルにギリシャ文字(ベータ)を使用する方法は? 式の引数をラベルに統合しようとしました=が動作しませんでした。
t$cell=factor(t$cell, levels = unique(t$cell), labels = c("WT","beta-DKO"))
私が試したコードの完全なバージョンです。入力ファイルはlinkでナビゲートしてください。
library(ggplot2)
library(Hmisc)
library(gridExtra)
library(grid)
t=read.csv(file.choose(), header = TRUE)
t$ligand = factor(t$ligand, levels = unique(t$ligand))
t$kd=factor(t$kd, levels = unique(t$kd))
t$cell=factor(t$cell, levels = unique(t$cell), labels = c("WT","beta-DKO"))
tbar=ggplot(t, aes(kd, uptake, fill=ligand)) +
stat_summary(fun.y = mean, geom = "bar", position="dodge", color = "black", size=0.3, width = 0.6) +
stat_summary(fun.data = mean_se, geom = "errorbar", position = position_dodge(width = 0.6), size=0.3, width = .2) +
scale_fill_manual(name="ligand", labels=c("-L", "+L"), values=c("gray20", "gray80"))+
theme_bw()+
scale_y_continuous(expand = c(0,0), limit = c(0, 120), breaks = seq(0, 110, 20))+
ylab("% of T")+
facet_wrap(~cell, nrow=1)+
theme(legend.direction="horizontal",legend.position=c(0.88,0.92))+
theme(legend.text=element_text(size=9))+
theme(legend.key.size=unit(0.25,"cm"))