How can I set the ylim in individual panels of a "multiple" plot.ts? The panels are all scaled to fully fit the series inside. But I need specific scales, and colors .... Here is an example: plot.ts(cbind(1:10,1:10/10),ylim=c(0,3)) # ylim has no effect Can someone more knowledgable please explain how to use the paneloption correctly, thanks! Cheers, m
Matthias Braeunig <mb.atelier <at> web.de> writes:> > How can I set the ylim in individual panels of a "multiple" plot.ts? > The panels are all scaled to fully fit the series inside. But I need > specific scales, and colors .... > > Here is an example: > > plot.ts(cbind(1:10,1:10/10),ylim=c(0,3)) # ylim has no effect >Personally, I tend to believe that this is an issue (being careful to avoid the zoological word, which is reseved for core members) in plot.ts, where xlim and ylim are not included in one of the plot.default calls. It works when you change (around line 40 in plot.ts) to plot.default(x[, i], axes = FALSE, xlab = "", ylab = "", log = log, col = col, bg = bg, pch = pch, ann = ann, type = "n",xlim=xlim,ylim=ylim, ...) But I am sure, that there were reasons to omit this, and I have not read the documentation carefully. Dieter
If you convert the ts object to a zoo object then it will invoke plot.zoo in which case ylim= will work: library(zoo) x <- cbind(1:10,1:10/10) plot(zoo(x), ylim = c(0,3)) On 7/12/06, Matthias Braeunig <mb.atelier at web.de> wrote:> How can I set the ylim in individual panels of a "multiple" plot.ts? > The panels are all scaled to fully fit the series inside. But I need > specific scales, and colors .... > > Here is an example: > > plot.ts(cbind(1:10,1:10/10),ylim=c(0,3)) # ylim has no effect > > Can someone more knowledgable please explain how to use the panel> option correctly, thanks! > > Cheers, m > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >