-1

所以基本上,我有这个 R 输出,我用它来制作一些折线图

    f    x  N       y           sd         se         ci         
1  Carla 1  5 0.577437500 0.538098341 0.240644894 0.668137337
2  Carla 2 21 1.975978653 3.258871642 0.711144094 1.483420586
3  Carla 3  8 1.217090357 1.936489842 0.684652549 1.618946022
4  Carla 4  6 0.004543219 0.002500954 0.001021010 0.002624590
5   Liam 1  4 0.356406250 0.203422619 0.101711309 0.323690780
6   Liam 2  8 5.164708412 5.169434477 1.827671087 4.321755376
7   Liam 3  4 0.019294020 0.002592634 0.001296317 0.004125459
8    Meg 1  3 0.337395833 0.383621255 0.221483835 0.952968025
9    Meg 2 11 2.218085777 3.889646592 1.172772574 2.613100136
10   Meg 3  3 2.239833477 3.810413346 2.199943171 9.465591491
11   Meg 4  3 0.004317894 0.002512864 0.001450803 0.006242301

我使用以下代码制作了一些折线图:

# Standard error of the mean
ggplot(dfc, aes(x=x, y=y, colour=f)) + 
    geom_errorbar(aes(ymin=y-se, ymax=y+se), width=.1) +
    geom_line() +
    geom_point()

# The errorbars overlapped, so use position_dodge to move them horizontally
pd <- position_dodge(.1) # move them .05 to the left and right

ggplot(dfc, aes(x=x, y=y, colour=f)) + 
    geom_errorbar(aes(ymin=y-se, ymax=y+se), width=.1, position=pd) +
    geom_line(position=pd) +
    geom_point(position=pd)

但我想知道是否可以“突出显示”标准错误和其他东西所占据的区域。

4

1 回答 1

2
ggplot(dfc, aes(x=x, y=y, colour=f, fill=f, ymin=y-se, ymax=y+se)) + 
  geom_ribbon(aes(colour=NULL),alpha=0.5) +
  geom_errorbar(width=.1) +
  geom_line() +
  geom_point() 
于 2013-07-04T12:47:04.537 回答