showViewport(viewport(width=.5, height=.5, name="vp"))
grid.newpage()
pushViewport(viewport(width=.5, height=.5, name="vp"))
upViewport()
showViewport(vpPath("vp"))
showViewport(vpStack(viewport(width=.5, height=.5, name="vp1"),
viewport(width=.5, height=.5, name="vp2")),
newpage=TRUE)
showViewport(vpStack(viewport(width=.5, height=.5, name="vp1"),
viewport(width=.5, height=.5, name="vp2")),
fill=rgb(1:0, 0:1, 0, .1),
newpage=TRUE)
Run the code above in your browser using DataLab