On 08/26/2010 08:11 AM, elaine kuo wrote:
...
One more request, if the label of axis X wants to be drawn from 5 to 1
(left to right)
rather than 1 to 5, is it fine to change axis (4, at = NULL) ?
If so, which value should be input ?


Hi Elaine,
There are a couple of ways to do this. One is to use the revaxis function (plotrix) that reverses the conventional direction of the axes by silently changing the sign of the values. If you use this, you must remember to change the sign of the position of your y axes. Another way is the plot in the normal direction but print the tick labels backwards:

plot(1:5,xaxt="n")
axis(1,1:5,5:1)

Using this method, you have to remember that your labels don't correspond to the values, so if you wanted a y axis positioned at x=4, you would have to use:

axis(2,1:5,pos=2)

Jim

______________________________________________
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