[R] How to plot diagonal line at any coordinate range in R

Gundala Viswanath gundalav at gmail.com
Mon Mar 12 06:15:05 CET 2012

Dear expert

How can we plot diagonal across (from bottom-left-hand corner to top
right-hand corner),
at any given coordinate range

For example

> plot(c(-2,3), c(-1,5), type = "n", xlab="x", ylab="y", asp = 1)
> plot(c(0,1000), c(0,334), type = "n", xlab="x", ylab="y", asp = 1)

I tried abline with the following but failed:

> abline(0,1,col="red")

- G.V.

More information about the R-help mailing list