I am attempting to plot a trellis object on a grid.

vplayout = viewport(layout.pos.row=x, layout.pos.col=y)

grid.newpage()
pushViewport(viewport(layout=grid.layout(2,2)))

g1 = ggplot() ...
g2 = ggplot() ...
g3 = ggplot() ...
p = xyplot() ...

# works as expected
print(g1, vp=vplayout(1,1))
print(g2, vp=vplayout(1,2))
print(g3, vp=vplayout(2,1))

# does not work
print(  p,
         newpage=FALSE,
         draw.in=vplayout(2,2)$name)

Error in grid.Call.graphics("L_downviewport", name$name, strict) :
  Viewport 'GRID.VP.112' was not found


What am I doing wrong?

Thanks!

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to