Sal*_*try 1 plot r ggplot2 dplyr
我目前使用 geom_smooth 函数来绘制细菌生长数据。
我想知道是否可以显示标准差而不是由标准误差计算的置信区间(我认为这是该函数的标准)
例子:
p1<-mtcars %>%
ggplot(aes(x=mpg,cyl)) +
geom_smooth( size=2, span=1,color="tomato",fill="tomato")
Run Code Online (Sandbox Code Playgroud)
所以我的问题是:
预先非常感谢!
现在可以直接在内部执行此操作,geom_smooth
因为我们可以根据内部计算的标准误差计算出标准偏差after_stat
mtcars %>%
ggplot(aes(mpg, cyl)) +
geom_smooth(size = 2, span = 1, color = "tomato", fill = "tomato",
aes(ymax = after_stat(y + se * sqrt(length(y))),
ymin = after_stat(y - se * sqrt(length(y)))))
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
270 次 |
最近记录: |