Dear R-users, Does anybody know in plot() how to set the values of the axis in reverse order, like in excel there is an option to format the axis? Best,Jing
Marc Schwartz
2006-Mar-17 01:10 UTC
[R] how to set the values of the axis in reverse order
On Fri, 2006-03-17 at 00:33 +0100, Jing Yang wrote:> Dear R-users, > > Does anybody know in plot() how to set the values of the axis in > reverse order, like in excel there is an option to format the axis? > > Best,JingJust reverse the range of the axis you want, using 'xlim' for x and/or 'ylim' for y: plot(1:10, xlim = c(10, 0)) See ?plot.default for more information. Sometimes using a construct such as: ylim = rev(range(YourVector)) may be helpful as well. See ?rev and ?range for more information. HTH, Marc Schwartz