age*_*nis 10 transparency r ggplot2 confidence-interval
我在2年前提到这个问题,用ggplot:调整stat_smooth线的透明度(alpha),而不仅仅是置信区间的透明度
建议的第一种方法允许单独设置置信区间的Alpha透明度:
ggplot(head(airquality, 60), aes(x=Day, y=Temp, color=factor(Month))) +
geom_point() + stat_smooth(method = "lm", se=TRUE, alpha=1.0)
Run Code Online (Sandbox Code Playgroud)

第二种方法允许为行本身设置alpha透明度,但在此期间你会失去置信区间,即使se=TRUE:
ggplot(head(airquality, 60), aes(x=Day, y=Temp, color=factor(Month))) +
geom_point() + geom_line(stat='smooth', method = "lm", se=TRUE, alpha=0.3)
Run Code Online (Sandbox Code Playgroud)

我的问题:如何控制平滑线和置信区间的透明度?
Rol*_*and 10
这会计算模型两次.但通常这不应该是性能问题.
ggplot(head(airquality, 60), aes(x=Day, y=Temp, color=factor(Month))) +
geom_point() +
geom_ribbon(stat='smooth', method = "lm", se=TRUE, alpha=0.1,
aes(color = NULL, group = factor(Month))) +
geom_line(stat='smooth', method = "lm", alpha=0.3)
Run Code Online (Sandbox Code Playgroud)
