[R] Revisiting multiple plots

2007-03-16 Thread Jonathan Wang
Suppose I create a multiple plot with zoo, using: index - ISOdatetime(2004, rep(1:2, 5), sample(28, 10), 0, 0, 0) foo - zoo(rnorm(10), index) for (i in 1:9) { data - rnorm(10) z1 - zoo(data, index) foo - cbind(foo, z1) } plot(foo) This creates 10 plots on one device, one for each column in

Re: [R] Revisiting multiple plots

2007-03-16 Thread Gabor Grothendieck
Try this (or use xyplot.zoo and write a panel function for that): library(zoo) set.seed(1) tt - as.Date(paste(2004, rep(1:2, 5), sample(28, 10), sep = -)) foo - zoo(matrix(rnorm(100), 10), tt) pnl - function(x, y, ...) { lines(x, y, ...) abline(h = mean(y)) } plot(foo, panel =