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 --
Gabor Grothendieck
2007-Oct-11 14:49 UTC
[R] strange: yaxis inversion with zoo not possible?
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. >