stack_layout {ggalign} | R Documentation |
Arrange plots horizontally or vertically
Description
If limits
is provided, a continuous variable will be required and aligned
in the direction specified (stack_continuous
). Otherwise, a discrete
variable will be required and aligned (stack_discrete
).
Several aliases are provided for convenience:
-
stack_vertical
: A special case ofstack_layout
that setsdirection = "v"
. -
stack_horizontal
: A special case ofstack_layout
that setsdirection = "h"
. -
stack_discretev
: A special case ofstack_discrete
that setsdirection = "v"
. -
stack_discreteh
: A special case ofstack_discrete
that setsdirection = "h"
. -
stack_continuousv()
: A special case ofstack_free
that setsdirection = "v"
. -
stack_continuoush()
: A special case ofstack_free
that setsdirection = "h"
.
For historical reasons, the following aliases are available:
-
stack_align
is an alias forstack_discrete
. -
stack_alignv
is an alias forstack_discretev
. -
stack_alignh
is an alias forstack_discreteh
. -
stack_free
is an alias forstack_continuous
. -
stack_freev
is an alias forstack_continuousv
. -
stack_freeh
is an alias forstack_continuoush
.
Usage
stack_layout(
direction,
data = NULL,
...,
theme = NULL,
sizes = NA,
limits = waiver()
)
stack_horizontal(data = NULL, ..., limits = waiver())
stack_vertical(data = NULL, ..., limits = waiver())
stack_discrete(direction, data = NULL, ..., theme = NULL, sizes = NA)
stack_discretev(data = NULL, ...)
stack_discreteh(data = NULL, ...)
stack_continuous(
direction,
data = NULL,
...,
limits = NULL,
theme = NULL,
sizes = NA
)
stack_continuousv(data = NULL, ...)
stack_continuoush(data = NULL, ...)
Arguments
direction |
A string indicating the direction of the stack layout,
either |
data |
Default dataset to use for the layout. If not specified, it must be supplied in each plot added to the layout:
|
... |
Additional arguments passed to |
theme |
A |
sizes |
A numeric value or a |
limits |
A |
Value
A StackLayout
object.
Examples
set.seed(123)
small_mat <- matrix(rnorm(56), nrow = 7L)
stack_horizontal(small_mat) + align_dendro()
# this is the same with:
stack_discrete("h", small_mat) + align_dendro()
stack_discreteh(small_mat) + align_dendro()
# For vertical layout:
stack_vertical(small_mat) + align_dendro()