我正在绘制一组带有阴影的数据,以遵循下限和上限值。我使用stat_smooth
对Est
值应用平滑,但我无法获得由UB和LB值指定的阴影区域以跟随平滑线。这里的数据:在ggplot2下手动着色平滑线
Quantiles Est LB UB
0.10 -4.39 -4.80 -4.00
0.25 -3.46 -3.72 -3.22
0.50 -3.11 -3.29 -2.91
0.75 -2.89 -3.15 -2.60
0.90 -1.69 -2.21 -1.09
这是我的ggplot代码:
ggplot(data,aes(y=Est,x=Quantiles)) + stat_smooth() +
geom_ribbon(aes(ymin=LB,ymax=UB),alpha=0.2)
在此先感谢您的帮助!
任何机会,你可以把问题一点点更多[重复性( http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example)通过提供一些数据来处理? – shekeine 2014-11-05 13:37:46