
Arrange plots crosswise horizontally or vertically
Source:R/layout-chain-stack-cross.R
stack_cross.RdThe stack_cross function is derived from stack_discrete() and allows
for different layout ordering indices within a single layout.
Two aliases are provided for convenience:
stack_crossv: A special case ofstack_crossthat setsdirection = "v"for vertical alignment.stack_crossh: A special case ofstack_crossthat setsdirection = "h"for horizontal alignment.
Usage
stack_cross(direction, data = NULL, ..., theme = NULL, sizes = NA)
stack_crossv(data = NULL, ...)
stack_crossh(data = NULL, ...)Arguments
- direction
A string indicating the direction of the stack layout, either
"h"(horizontal) or"v"(vertical).- data
Default dataset to use for the layout. If not specified, it must be supplied in each plot added to the layout,
fortify_matrix()will be used to convert the data to a matrix.- ...
Additional arguments passed to
fortify_matrix().- theme
A
theme()object used to customize various elements of the layout, includingguides,title,subtitle,caption,margins,panel.border, andbackground. By default, the theme will inherit from the parentlayout. It also controls the panel spacing for all plots in the layout.- sizes
A numeric value or a
unitobject. When used for thequad_layout()annotation, it must be of length1. When used in thestack_layout()with a nestedquad_layout(), it should be of length3, specifying the relative heights (fordirection = "h") or widths (fordirection = "v") to be applied to the layout.