Skip to content
Prev 138620 / 398503 Next

Reversed but positive axis in trellis plots?

On 3/5/08, Fredrik Karlsson <dargosch at gmail.com> wrote:
You can always specify explicit limits that are reversed, e.g.,
ylim=c(100, 0). If you want this as a general behaviour but don't know
your data's range beforehand, one option might have been

    prepanel = function(x, y, ...) {
        list(ylim = rev(range(y)))
    }

Unfortunately, this doesn't work when relation="same", as the step of
combining the per-panel limits to obtain a common range disregards the
order.

-Deepayan