R语言ggplot2绘图拟合曲线的置信区间边框变成虚线
2021-07-25 本文已影响0人
小明的数据分析笔记本
library(ggplot2)
ggplot(data = mtcars,
mapping = aes(x = wt,
y = mpg)) +
geom_point(size = 2) +
geom_smooth(method = "loess",
se = FALSE,
colour = "black") +
geom_ribbon(stat = "smooth",
method = "loess",
se = TRUE,
alpha = 0, # or, use fill = NA
colour = "black",
linetype = "dotted")