Description Usage Details Value Warning Author(s) See Also Examples
This will generate a list of grid viewports which correspond to the current inner, figure, and plot regions of the current base plot.
1 |
The figure region is relative to the inner region so you must push the inner region before pushing the figure region. Similarly, the plot region is relative to the figure region so this should only be pushed after the previous two.
A list with three elements:
inner |
A viewport corresponding to the inner region of the current plot. |
figure |
A viewport corresponding to the figure region of the current plot. |
plot |
A viewport corresponding to the plot region of the current plot. |
If you resize the device, all bets are off!
Paul Murrell
Grid, viewport
1 2 3 4 5 6 7 8 9 10 11 | library(grid)
par(oma=rep(1, 4), mfrow=c(1, 2), xpd=NA)
plot(1:10)
vps <- baseViewports()
pushViewport(vps$inner)
grid.rect(gp=gpar(lwd=3, col="red"))
pushViewport(vps$figure)
grid.rect(gp=gpar(lwd=3, col="green"))
pushViewport(vps$plot)
grid.rect(gp=gpar(lwd=3, col="blue"))
grid.points(1:10, 10:1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.