Hi G.V. Does it fit to your request?
plot(c(-2,3), c(-1,5), type = "n", xlab="x", ylab="y", asp = 1) dg <- par("usr") segments(dg[1],dg[3],dg[2],dg[4], col='red') Regards, Pascal ----- Mail original ----- De : Gundala Viswanath <gunda...@gmail.com> À : r-h...@stat.math.ethz.ch Cc : Envoyé le : Lundi 12 mars 2012 14h15 Objet : [R] How to plot diagonal line at any coordinate range in R 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) or > 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. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.