[R] multipanel display of levelplots?

Yan Wang yanw at stat.berkeley.edu
Sun Apr 25 10:51:24 CEST 2004


I cannot achieve a multipanel display of several levelplots. Here is 
part of my code.

At first, create the layout:
push.viewport(viewport(layout=grid.layout(1, 2)))

Then for the left panel:
push.viewport(viewport(layout.pos.col=1,layout.pos.row=1))
push.viewport(viewport(width=0.6, height=0.6))
levelplot(z~x*y, grid)
pop.viewport()

Similar code for the right panel.

However, there is always error message for "pop.viewport()" as "Error in 
pop.vp(i == n, recording) : Illegal to pop top-level viewport". If I 
omit "pop.viewport()", the two levelplots were printed on seperate pages 
without a layout of (1,2).

Any suggestion is greatly appreciated.




More information about the R-help mailing list