Description Usage Arguments Details Value
grid turns an ordinary layer into an array of subplots laid out in a grid. Each subplot inherits the mappings, stat, and parameters of the initial layer. The mappings and stat for each subplot are mapped just to the data that occurs in the subplot's region on the grid. Any variables in the layer's data set may be used as x and y axes to create a grid on. These 'major' x and y axes need not correspond to the 'minor' x and y axes within each subplot. Major x and y axes are set with the grid.aes argument. Minor x and y axes are inherited from the layer's original mapping. To allow interpretation, the major axes of a gridded layer should correspond to the x and y aesthetics for any other (non - gridded) layers in the plot.
1 2 3 4 |
layer |
a ggplot2 layer object. See
|
grid.aes |
An aesthetic mapping, usually constructed
with |
x.nbin |
numeric. The number of bins to divide the major x axis into when creating the grid. Defaults to 10. |
y.nbin |
numeric. The number of bins to divide the major y axis into when creating the grid. Defaults to 10. |
x_scale |
function. The scaling to use for the x
axis within each glyph. If x_scale equals
|
y_scale |
function. y_scale behaves the same as x_scale but controls the scales for the y axis within each glyph. |
width.adjust |
numeric. The proportion of horizontal space within a grid box that each subplot should occupy. Used to control overlapping and appearance. Each subplot is anchored to the bottom left corner of the grid box and then spans the proportion of the box specified by width adjust. |
height.adjust |
numeric. The proportion of vertical space within a grid box that each subplot should occupy. Behaves the same as width.adjust. |
reference |
function. Function used to create
reference objects for the embedded plots. If NULL, no
reference objects are used. Reference objects are plotted
on a layer beneath the subplots. They provide a
consistent frame of reference to aid comparisons across
subplots. Functions that create reference objects include
|
ply.aes |
logical. If TRUE (default) aesthetics are
calculated separately for each subplot, as with
|
.ref |
internal argument used for plotting reference objects. |
The layout of the grid is specified by separately choosing the number of bins to use along the x and y axes with the x.nbin and y.nbin arguments.
Gridded layers follow usual data inheritence rules for
ggplot2 layer objects. If a layer contains no data, grid
will use the global data set for the plot. This is the
data set specified in ggplot
.
an object of class glayer
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.