Description Usage Arguments Value Author(s) Examples
Given a particular number of plots, auto.layout
will automatically determine the arrangement of each
plot using the layout
function. See examples.
1 | auto.layout(n, layout = T)
|
n |
the number of plots |
layout |
should the fuction return a preallocated layout object? If |
either a matrix or a layout object
Dustin Fife
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## plot six plots
auto.layout(6)
for (i in 1:6){
plot(rnorm(100), rnorm(100))
}
## same as mar(mfrow=c(3,2))
par(mfrow=c(3,2))
for (i in 1:6){
plot(rnorm(100), rnorm(100))
}
## default for odd number of plots using mfrow looks terrible
par(mfrow=c(3,2))
for (i in 1:5){
plot(rnorm(100), rnorm(100))
}
## much better with auto.layout
auto.layout(5)
for (i in 1:5){
plot(rnorm(100), rnorm(100))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.