![](/img/trans.png)
[英]ggplot2 - x-axis ticks and labels not compatible with regression line (geom_smooth and geom_abline)
[英]Plot dashed regression line with geom_smooth in ggplot2
根據幫助頁面(參見?geom_smooth
), ?geom_smooth
是geom_smooth理解的美學之一。
因此,您可以調整為使用geom_smooth(method = "lm", se = FALSE, linetype="dashed")
library(ggplot2)
ggplot(mtcars, aes(x = hp, y = mpg)) +
geom_point() +
geom_smooth(method = "lm", se = FALSE, linetype = "dashed") +
theme_bw()
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.