[R] abline does not show on plot if slope differs from 0
ggrothendieck at gmail.com
Sun Aug 30 18:34:29 CEST 2009
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 Pozsgai<pozsgaig at gmail.com> wrote:
> 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 fine as well.
> Pozsgai Gábor
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help