Getting the same y-axis in a multivariate time series plot - plot(ts(...)); ylim does not do the trick

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Getting the same y-axis in a multivariate time series plot - plot(ts(...)); ylim does not do the trick

Søren Højsgaard
I try to obtain the same y-axis for a 2-dim time series with
 
  plot(ts(cbind(rnorm(10), rnorm(10,mean=4))),ylim=c(0,20))

but that does not work. Looking in the code for plot.ts, the ylim-argument seems to be taken care of, but not the way I expect. Can anyone help on this?
Thanks
Søren

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: Getting the same y-axis in a multivariate time series plot - plot(ts(...)); ylim does not do the trick

Gabor Grothendieck
If you use plot.zoo it will do it.  Just insert as.zoo(...) around
the ts object.

library(zoo)
plot(as.zoo(ts(cbind(rnorm(10), rnorm(10,mean=4)))),ylim=c(0,20))

On 12/29/05, Søren Højsgaard <[hidden email]> wrote:

> I try to obtain the same y-axis for a 2-dim time series with
>
>  plot(ts(cbind(rnorm(10), rnorm(10,mean=4))),ylim=c(0,20))
>
> but that does not work. Looking in the code for plot.ts, the ylim-argument seems to be taken care of, but not the way I expect. Can anyone help on this?
> Thanks
> Søren
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html