-2
我编写这样的:添加回归线传奇geom_abline
ggplot() +
geom_point(mapping = aes(x = X, y = y)) +
geom_abline(intercept = -0.9930872, slope = 0.4866284, colour = "red") +
geom_abline(intercept = -1, slope = 0.5, colour = "blue")
,但似乎无法得到一个工作传说为我的最小二乘populuation回归线。我试过各种堆栈溢出的答案,但似乎没有给我我需要的东西。
Add a legend to a ggplot2 scatter plot including additional lines
这看起来像最好的答案,但我不能得到它的工作!
有什么建议吗?
这看起来很完美!我明天会试试...谢谢! – PS94