How to specify equation for regression line in ggp

2019-07-22 20:22发布

I want to create a scatterplot in ggplot2 with one or more lines over-layed. Having looked at the documentation for geom_smooth() and geom_line(), it remains unclear to me how I can specify the equations for lines that I want to add to a plot. I understand that this must be very basic, so please feel free simply to point me toward the appropriate documentation that I must have overlooked.

标签: r ggplot2
1条回答
戒情不戒烟
2楼-- · 2019-07-22 21:21

geom_abline() is the name of the geom you're looking for, e.g. geom_abline(aes(intercept=a,slope=b)). There are examples in the online documentation.

查看更多
登录 后发表回答