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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章