That's fantastic!  Thanks.

> -----Original Message-----
> From: Marc Schwartz [mailto:marc_schwa...@me.com]
> Sent: Friday, June 17, 2011 3:47 PM
> To: Owen, Jason
> Cc: 'r-help@r-project.org'
> Subject: Re: [R] plot the y-axis upside down
>
> On Jun 17, 2011, at 2:31 PM, Owen, Jason wrote:
>
> > Hello,
> >
> > I need to create a scatterplot where the y-axis is upside down.  If I
> have non-negative bivariate data in objects "x" and "y," then the
> operation
> >
> > plot(x, -y)
> >
> > gives me the figure I want -- a mirror image of plot(x, y) -- except
> that the y-values (coordinates) are negative, which I don't want.  Is
> there a simple way to do this?
> >
> > Jason
>
>
> This is where the 'ylim' argument to plot is helpful, along with ?rev
> and ?range:
>
>   x <- 1:10
>   y <- 1:10
>   plot(x, y)
>
> versus:
>
>   plot(x, y, ylim = rev(range(y)))
>
> HTH,
>
> Marc Schwartz

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

Reply via email to