From dmurdoch at pair.com  Wed Nov 12 14:02:11 2003
From: dmurdoch at pair.com (Duncan Murdoch)
Date: Wed Nov 12 14:01:12 2003
Subject: [Rd] wishlist item: changing origin of plot (PR#5045)
In-Reply-To: <20031112092428.D2637F77F@slim.kubism.ku.dk>
References: <20031112092428.D2637F77F@slim.kubism.ku.dk>
Message-ID: <udb4rv43jq0tbkelcp16qtcqsebmkmamj4@4ax.com>

On Wed, 12 Nov 2003 10:24:28 +0100 (CET), you wrote:

>Do you think it would be worth adding options to plot commands to
>reverse axes?
>
>Here is a simple example:
> 
>> x <- 1:12
>> plot(x)
>  
>Whereas if I want the x-axis reversed, I need to know the range of
>the x data points:
> 
>>  plot(x, xlim=c(12,1))

This seems like a fairly obscure need, and it can be done by
calculating the range of x at plot time, e.g.

 plot(x, y, xlim=rev(range(x)))

or

 plot(y, xlim=c(length(y),1))

I'd be happier with including one of those in the example code rather
than with adding another couple of parameters to par.

Duncan Murdoch


[Rd] wishlist item: changing origin of plot (PR#5045)
Duncan Murdoch