[R] strange: yaxis inversion with zoo not possible?

Gabor Grothendieck ggrothendieck at gmail.com
Thu Oct 11 16:49:20 CEST 2007


This looks like a bug.  Currently plot.zoo takes over ylim.
Here is a workaround:

library(zoo)
x.zoo <- zoo(1:50)
plot(x.zoo, type="h", ylim = c(0, 10), yaxt = "n")
axis(2, 0:10, 10:0)


On 10/11/07, marcg <mdgi at gmx.ch> wrote:
> hej there
>
> I want to invert the yaxis as follows:
>
> x<-rnorm(1:50)
> plot(x^2, type="h", ylim=c(0,10))
> plot(x^2, type="h", ylim=c(10,0))
>
> then doing the following it won't work - kind of strange isn't it?
>
> x.zoo<-zoo(x^2)
> plot(x.zoo, type="h", ylim=c(10,0))
> plot(x.zoo, type="h", ylim=c(0,10))
>
> how can I invert the axis with zoo objects?
>
> Marc
> --
>
> ______________________________________________
> R-help at 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.
>



More information about the R-help mailing list