Skip to content
Prev 154843 / 398506 Next

two lattice graphs in one object

Deepayan,

that is exactly what I was hoping for. Thanks much!

Experimenting with it I noticed that updating two existing objects with plot arguments seems to not work, at least not in this way:

gr1 <-xyplot(rnorm(111) ~ runif(111), main = "Plot A")
gr2 <- xyplot(runif(111) ~ runif(111), main = "Plot B")

plist <- list(
  update(gr1, plot.args = list(position = c(0, 0, 1, 0.5), more = TRUE)),
  update(gr2, plot.args = list(position = c(0, 0.5, 1, 1), more = FALSE))
)

print(plist)
gives me two separate pages, even though the object is updated:
$plot.args
$plot.args$position
[1] 0.0 0.0 1.0 0.5

$plot.args$more
[1] TRUE

I can get it to work the "dirty" way:
plist[[1]]$plot.args <-  list(position = c(0, 0, 1, 0.5), more = TRUE)
plist[[2]]$plot.args <-  list(position = c(0, 0.5, 1, 1), more = FALSE)

Shouldn't update work as well? 
(R version 2.6.2, platform i386-pc-mingw32)

Thanks again!

  Andreas

 On Tue Sep  2 21:43 , "Deepayan Sarkar"  sent: