[R] plot.ts versus plot.zoo

Gabor Grothendieck ggrothendieck at gmail.com
Wed Sep 22 14:28:47 CEST 2010


On Wed, Sep 22, 2010 at 8:07 AM, Alex van der Spek <doorz at xs4all.nl> wrote:
> plot.ts has an argument yax.flip, plot.zoo does not.
>
> Is there a way to make the yaxis flip in plot.zoo?
>
> I tried using a custom panel function:
>
> panel.yaxis<-function(...) {
>    npnl<-parent.frame$panel.number
>    if (npnl %% 2 == 0) {
>        axis(side=3)
>    } else {
>        axis(side=2)
>    }
> }


Depending on your zoo series, you may be able to do this:

plot(as.ts(z), yax.flip = TRUE)



-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com



More information about the R-help mailing list