数据是:
df <- structure(list(vec = c("PC", "DEFAULT", "INFORMED"), mean = c(1.34944359241928,
1.36249329506777, 1.34671188869646), sd = c(0.57779881866326,
0.537279303541924, 1.53585580464849), min = c(0.196903771571785,
0.28781509871908, -1.66860228474139), `0.5quant` = c(1.35295469982876,
1.36643973099316, 1.34687516700723), max = c(2.48177705326348,
2.41483607230639, 4.36109982194179), mode = c(NA_real_, NA_real_,
NA_real_), kld = c(1.9807860333589e-08, 2.97333113261951e-08,
3.91753938449056e-10), ID = 1:3), row.names = c(NA, -3L), class = "data.frame")
我想将其绘制为:
yaxis <- c("Ppppppppp ppppppp
pppp pp pppppp
(ppp)", "Uuuuuuuuu uuuuu", "Iiiiiii iiiii
ii Iiiiii (iiii)")
myplot <- ggplot(data = df, aes(x = mean, y = ID)) +
geom_point() +
geom_errorbarh(aes(xmin = min, xmax = max), height = .1) + geom_vline (xintercept = 0, linetype = 2) + scale_x_continuous(breaks=seq(-4,4.5,0.5)) + scale_y_continuous(breaks = 1:3, labels = yaxis)
我的问题如下:
-
我想缩小y轴上"i"、"u"和"p"之间的距离:换句话说,白线必须消失(相应地,我在图表中用红色标记将它们划掉),三条黑线(可信/置信区间)必须位于y轴上更近的位置.
-
我想将标签中的文本置于y轴的中心(我用蓝色标记圈出它们).换句话说,每个标签中的文本必须居中.
伙计们,你们能帮我一下吗?