R语言ggplot2绘图拟合曲线的置信区间边框变成虚线

https://stackoverflow.com/questions/57988682/how-to-remove-filled-area-on-se-when-plot-geom-smooth-in-ggplot2

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")

你可能感兴趣的:(R语言ggplot2绘图拟合曲线的置信区间边框变成虚线)