Arrange plots horizontally or vertically by aligning continuous axis
Source:R/layout-stack-.R
stack_continuous.Rd
The stack_continuous
function arranges plots by aligning continuous
variables. The alias stack_free
is retained for historical reasons.
stack_continuousv()
/stack_freev
: A special case ofstack_free
that setsdirection = "v"
.stack_continuoush()
/stack_freeh
: A special case ofstack_free
that setsdirection = "h"
.
Usage
stack_continuous(
direction,
data = NULL,
...,
limits = NULL,
theme = NULL,
sizes = NA
)
stack_free(
direction,
data = NULL,
...,
limits = NULL,
theme = NULL,
sizes = NA
)
stack_continuousv(data = NULL, ...)
stack_freev(data = NULL, ...)
stack_continuoush(data = NULL, ...)
stack_freeh(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_data_frame()
will be used to convert data to a data frame. Note that if the data is amatrix
, it will be automatically converted to a long-formatted data frame, which differs fromggplot2
's behavior.- ...
Additional arguments passed to
fortify_data_frame()
.- limits
A
continuous_limits()
object specifying the left/lower limit and the right/upper limit of the scale. Used to align the continuous axis.- 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
unit
object. 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.