[R] Reversing x-axis

Kjetil Kjernsmo kjetil.kjernsmo at astro.uio.no
Thu Dec 7 20:12:12 CET 2000

Dear all,

I'm making a system to create a star-chart, and I have encountered one of
the intuitive and clearly thoughtful conventions that are so common in
astronomy :-J... Well, the point being, I have to reverse the x-axis.
I figured, I might just set xlim=rev(range(x)). Do e.g.
> x <- 0:5
> y <- (0:5)^3
> plot(x, y)
> plot(x, y, xlim=rev(range(x)))
The problem is that here (R-, osf4.0e), the numbers on the axis
doesn't come out right when I do this. Only the last tick mark has a
number, namely min(x). Is this a bug or a feature?

Anybody have a good workaround? I've tried (for this example)
axis(1, rev(x), rev(x))


Kjetil Kjernsmo
Graduate astronomy-student                    Problems worthy of attack
University of Oslo, Norway            Prove their worth by hitting back
E-mail: kjetikj at astro.uio.no                                - Piet Hein
Homepage <URL:http://www.astro.uio.no/~kjetikj/>
Webmaster at skepsis.no

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list