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 z. Note that prod(size) must match the length of the third dimension of z (if it is an array), or c(1, 1) if z is a matrix.

legend

A character string indicating where the color scale should be placed. The default is "horizontal". The other valid options are "none" and "vertical".

common.legend

A logical value indicating whether a common legend scale should be used for all images provided in the z array. Default is TRUE. If FALSE, a separate legend is used for each image.

lratio

A numeric value indicating the ratio of the width of the legend scale to the width of the each image. Default is lratio = 0.2.

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 oma argument of the par function.

show

A logical value indicating whether the layout.show function should be called after the layout is constructed.

reverse

A logical value indicating whether the legend scale should be plotted before the image. Default is FALSE.

legend.mar

The margins for the legend. (See the mar argument of par). If not specified, then sensible values are chosen based on the current vector par("mar").

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

image, image.plot, axis

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)

[Package autoimage version 2.2.3 Index]