为什么我的GGPlot软件包中的AB线不可见?

时间:2019-11-18 17:58:34

标签: r ggplot2

也许这是最愚蠢的问题,它为我工作了100万次,但是在图中看不到我的Ab线。我在做什么错了?

我的代码

plot =ggplot(data=NULL, aes(x= data$ï..Year, y= loggdp))+
  geom_line(col="blue")+
  geom_abline( slope=0.01994632, intercept=11.96591, col="red" )

这是我得到的图

And this is the graph I get

1 个答案:

答案 0 :(得分:1)

可能是因为它在可见区域之外。对于x=2000(2000年),您通过的斜率和截距(大致)通过的值为11.96 + 2000*0.02 = 51.96,该值不在此图中的y轴范围内。