autolayout {autoimage} | R Documentation |
Divide device into rows and columns
Description
autolayout
divides the current device into equal-sized rows
and equal-sized columns based on the specified arguments.
Usage
autolayout(
size,
legend = "none",
common.legend = TRUE,
lratio = 0.2,
outer = FALSE,
show = TRUE,
reverse = FALSE,
legend.mar
)
Arguments
size |
A vector of length two indicating the number of rows
and columns that should be used for the series of image data in
|
legend |
A character string indicating where the color scale
should be placed. The default is |
common.legend |
A logical value indicating whether a common
legend scale should be used for all images provided in the
|
lratio |
A numeric value indicating the ratio of the width of
the legend scale to the width of the each image. Default is
|
outer |
A logical value indicating whether the room should be
left for an outer title that is common for all plots. Depends on
setting the |
show |
A logical value indicating whether the
|
reverse |
A logical value indicating whether the legend scale
should be plotted before the image. Default is |
legend.mar |
The margins for the legend. (See the |
Details
The rows and columns are constructed using the
layout
function, which is incompatible with
the mfrow
and mfcol
arguments in the
par
function and is also incompatible with
the split.screen
function.
Note par
parameters are NOT RESET after
executing the layout
function so the the
user can use existing layout for plots.
If legend = "horizontal"
or legend = "vertical"
, then
a portion of the device is dedicated to a legend.
If common.legend = TRUE
, then one legend region is created
for the entire set of plots. If common.legend = FALSE
, then
a separate legend region is created for each individual plot.
With respective to ordering of the plotting regions: A common legend is plotted after all other plots, while individual legends are plotted after each respective plot.
See Also
Examples
# basic 2x2 layout
autolayout(c(2, 2))
# 3x2 layout with space for legends
autolayout(c(3, 2), legend = "h")
autolayout(c(3, 2), legend = "v")
# 3x2 layout with individuals legends
autolayout(c(3, 2), legend = "h", common.legend = FALSE)
autolayout(c(3, 2), legend = "v", common.legend = FALSE)
# if outer title is desired
autolayout(c(2, 2), outer = TRUE)
# reset oma parameters
par(oma = c(0, 0, 0, 0))
# impact of lratio when legend used
autolayout(c(2, 2), legend = "h", lratio = 0.5)
autolayout(c(2, 2), legend = "h", lratio = 0.2)