getFig | R Documentation |
This function can be used with the layout
function for defining the positioning of multiple plots on a single plotting device. Given a matrix used in the layout
function and the number indicating which a particular subplot area, it returns the min/max x- and y-coordinates for the subplot relative to the entire plottig region.
getFig(layout, n)
layout |
Matrix representing the positioning of subplots. See |
n |
Integer, indicating which suboplot to plot (corresponds to value(s) in |
A four-element numeric vector.
lo <- matrix(c(1, 2, 3), nrow=1)
layout(lo)
subplot1 <- getFig(lo, 1)
subplot2 <- getFig(lo, 2)
subplot3 <- getFig(lo, 3)
par(fig=subplot2, new=FALSE)
plot(1, 1, main='Subplot 2')
par(fig=subplot1, new=TRUE)
plot(1, 1, main='Subplot 1')
par(fig=subplot3, new=TRUE)
plot(1, 1, main='Subplot 3')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.