[R] abline does not show on plot if slope differs from 0

2009-08-30 Thread Gábor Pozsgai
Hi, Does anybody have a hint why this does not work? plot(c(1991,2000), c(-1,10))abline(a=6, b=-1, col=dark grey, lty=dashed) It does not generate an error message, but the line does not turn up. If b=0 it works fine. If I change the axes of the plot to plot(c(1,10), c(-1,10)) it does work

Re: [R] abline does not show on plot if slope differs from 0

2009-08-30 Thread jim holtman
Very simple, look at the x-axis you are plotting with. If you want the line, then use: abline(a=1996, b=-1, col=dark grey, lty=dashed) On Sun, Aug 30, 2009 at 12:25 PM, Gábor Pozsgaipozsg...@gmail.com wrote: Hi, Does anybody have a hint why this does not work? plot(c(1991,2000),

Re: [R] abline does not show on plot if slope differs from 0

2009-08-30 Thread Gabor Grothendieck
The intercept, a, is the value when x = 0. Thus if you want y = 6 when x = 1991 then the line is y = 6 - (x-1991) = 1997 - x so a = 1997: abline(a=1997, b=-1, col=dark grey, lty=dashed) On Sun, Aug 30, 2009 at 12:25 PM, Gábor Pozsgaipozsg...@gmail.com wrote: Hi, Does anybody have a hint