更改 geom_pointrange 中点的宽度

Change width of points in geom_pointrange

我刚开始学习 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

编辑情节: 我希望我的盒装宽度与胡须宽度相同

虽然没有记录,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