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

Jeff Newmiller jdnewmil at dcn.davis.ca.us
Mon Mar 12 06:23:59 CET 2012


Your requirement that the line go from bottom-left to top-right regardless of the coordinates is inconsistent with a slope of 1. Are you sure that is your requirement?
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.

Gundala Viswanath <gundalav at gmail.com> wrote:

>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 at 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.



More information about the R-help mailing list