Hi all, Can anyone tell me how I can make 0,0 start at the top left hand corner of a graph, instead of the typical lower left hand corner? I've tried to plot with axes=F and then putting on the axes later, but I want the points to correspond to the axes. Thanks, Kang Min
Hi, I don't understand the question. If your data is in the fourth quadrant (all positive Xs, all negative Ys) this will happen automatically as the standard R plot plots only in the range where there is data, e.g. x=rnorm(100,0,1) e=rnorm(100,0,1) y=-abs(x)-abs(e) plot(y~x,bty="n") Please be more precise about your question. Cheers, Daniel ------------------------- cuncta stricte discussurus ------------------------- -----Urspr?ngliche Nachricht----- Von: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] Im Auftrag von Plantky Gesendet: Monday, November 17, 2008 11:46 PM An: r-help at r-project.org Betreff: [R] Changing the position of the origin Hi all, Can anyone tell me how I can make 0,0 start at the top left hand corner of a graph, instead of the typical lower left hand corner? I've tried to plot with axes=F and then putting on the axes later, but I want the points to correspond to the axes. Thanks, Kang Min ______________________________________________ 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.
Plantky wrote:> Hi all, > > Can anyone tell me how I can make 0,0 start at the top left hand > corner of a graph, instead of the typical lower left hand corner? I've > tried to plot with axes=F and then putting on the axes later, but I > want the points to correspond to the axes. > > Thanks, > Kang MinDoes this what you want? x <- runif(10) y <- -runif(10) plot(x, y, xlim=c(0, max(x)), ylim=c(min(y), 0), axes=FALSE) axis(2) axis(3) box() Thomas P.
If I understand what you're seeking to do, you might also consider the rplot() function written by Rolf Turner. It can be found at http://tolstoy.newcastle.edu.au/R/help/02a/1174.html Benjamin -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Plantky Sent: Monday, November 17, 2008 11:46 PM To: r-help at r-project.org Subject: [R] Changing the position of the origin Hi all, Can anyone tell me how I can make 0,0 start at the top left hand corner of a graph, instead of the typical lower left hand corner? I've tried to plot with axes=F and then putting on the axes later, but I want the points to correspond to the axes. Thanks, Kang Min ______________________________________________ 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. P Please consider the environment before printing this e-mail Cleveland Clinic is ranked one of the top hospitals in America by U.S. News & World Report (2008). Visit us online at http://www.clevelandclinic.org for a complete listing of our services, staff and locations. Confidentiality Note: This message is intended for use\...{{dropped:13}}