我刚刚开始学习ggplot2,并且被困在用geom_pointrange改变点的宽度上
我的数据:
Pop Beta SE Size lo hi name
2 std1 -1.9590 0.30000000 601 -2.259000 -1.659000 std1
1 std2 -2.2170 0.17480000 1532 -2.391800 -2.042200 std2
3 std3 -2.3180 0.17160000 1763 -2.489600 -2.146400 std3
4 std4 -2.0940 0.18700000 1176 -2.281000 -1.907000 std4
5 std6 -1.5080 0.19670000 1136 -1.704700 -1.311300 std6
6 meta -2.0561 0.08695935 6208 -2.143059 -1.969141 meta
情节:
p <- ggplot()+
geom_pointrange(data=data, aes(x=name, y=Beta, ymin=lo, ymax=hi), shape=c(rep(22,5),23), lwd=0.3,
fill=c(rep("white",5),"white"), color = c(rep("#525252",5),"red"),
fatten = c((data$Size/200)[c(1:5)],5)) +
geom_hline(yintercept = 0, linetype=2)+
coord_flip()+
xlab('') + theme_bw(base_size = 15) +
ylab("") + ggtitle(paste(trait,i,sep=" "))
plot(p)
我的问题是,我希望晶须非常薄,以及作为点,但是当我改变lwd
参数时,只有晶须宽度发生变化。我试过使用width
,但得到了一个错误:
Warning: Ignoring unknown parameters: width
用情节编辑:我想要我的盒子的宽度和胡子的宽度相同
发布于 2017-02-20 13:57:09
虽然没有文档说明,但geom_pointrange
对中心点的参数与geom_point
所做的相同。在?geom_point
的例子中,我们可以读到:
# For shapes that have a border (like 21), you can colour the inside and
# outside separately. Use the stroke aesthetic to modify the width of the
# border
https://stackoverflow.com/questions/42345605
复制相似问题