grid.layout {grid} | R Documentation |
This function returns a Grid layout, which describes a subdivision of a rectangular region.
grid.layout(nrow = 1, ncol = 1, widths = unit(rep(1, ncol), "null", unit.per = T), heights = unit(rep(1, nrow), "null", unit.per = T), default.units = "null", respect = FALSE)
nrow |
An integer describing the number of rows in the layout. |
ncol |
An integer describing the number of columns in the layout. |
widths |
A numeric vector or unit object describing the widths of the columns in the layout. |
heights |
A numeric vector or unit object describing the heights of the rows in the layout. |
default.units |
A string indicating the default units to use
if widths or heights are only given as numeric vectors. |
respect |
A logical value indicating whether row heights and column widths should respect each other. |
The unit objects given for the widths
and heights
of a layout may use a special units
that only has
meaning for layouts. This is the "null"
unit, which
indicates what relative fraction of the available width/height the
column/row occupies. See the reference for a better description
of relative widths and heights in layouts.
A Grid layout object.
This function must NOT be confused with the base R graphics function
layout
. In particular, do not use layout
in
combination with Grid graphics. The documentation for
layout
may provide some useful information and this
function should behave identically in comparable situations. The
grid.layout
function has added the ability to specify a broader range
of units for row heights and column widths, and allows for nested
layouts (see viewport
).
Paul Murrell
Murrell, P. R. (1999), Layouts: A Mechanism for Arranging Plots on a Page, Journal of Computational and Graphical Statistics, 8, 121134.
Grid,
grid.show.layout
,
viewport
,
layout
# A variety of layouts (some a bit mid-bending ...) layout.torture()