geom_segment与geom_point结合使用

时间:2014-09-15 09:19:03

标签: r ggplot2

我正在ggplot中绘制一个geom_point,我希望将它与x-asis中的一个段组合到该点。如何指定段应从<轴>

 head(pValues_Both.m)

  value
1 5.502
2 0.823
3 0.374
4 3.886
5 0.724
6 0.706

ggplot(pValues_Both.m, aes(x=seq_along(value),y=value)) +   geom_segment(aes(yend=value), xend=0, colour="grey50") +
  geom_point(size=3.5,colour="#2E64FE")

1 个答案:

答案 0 :(得分:1)

您还应将seq_along(value)用作xend=的{​​{1}}内的aes()值。

geom_segment()