![](/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.