[R] flipping a plot vertically?

Berton Gunter gunter.berton at gene.com
Thu Jun 15 20:35:00 CEST 2006

> Any idea how to get the x axis numbers to go 
> along the top instead of the bottom?

Use xaxt = 'n' in your plot call (?par for details) to suppress plotting of
the axis and then add the axis via a call to axis().

If you do a lot of plotting, you may wish to purchase a copy of Murrell's R
GRAPHICS or V&R's MASS. At the very least, do read the relevant sections of
an Introduction to R and the Reference Manual, as I believe this sort of
thing is covered there.

-- Bert Gunter
Genentech Non-Clinical Statistics
South San Francisco, CA
"The business of the statistician is to catalyze the scientific learning
process."  - George E. P. Box

> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch 
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Tim Brown
> Sent: Thursday, June 15, 2006 11:18 AM
> To: r-help at stat.math.ethz.ch
> Subject: Re: [R] flipping a plot vertically?
> That works great.  Thanks.
> Any idea how to get the x axis numbers to go 
> along the top instead of the bottom?
> tim
> At 11:46 AM 6/15/2006, you wrote:
> >[Tim Brown]
> >
> >>This seems like an obvious question but I can't 
> >>find the answer in the "par" help document --- 
> >>I'd like to make a plot where the 0,0 point is 
> >>in the top left of the screen rather than 
> >>bottom left... .  [...] Any suggestions?
> >
> >You might retry your plot, adding an ylim=c(HIGHEST, LOWEST) 
> argument,
> >that is, listing the maximum before the minimum.  For example:
> >
> >   plot(1:10, ylim=c(10, 1))
> >
> >--
> >François Pinard   http://pinard.progiciels-bpi.ca
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html

More information about the R-help mailing list