This function integrates the functionalities of stack_free()
and
stack_align()
into a single interface. ggstack
is an alias for
stack_layout
.
Arguments
- data
Default dataset to use for the layout. If not specified, it must be supplied in each plot added to the layout. By default, it will try to inherit from parent layout:
If
type
isalign
,fortify_data_frame()
will be used to get a data frame.If
type
isfree
,fortify_matrix()
will be used to get a matrix.
- direction
A string indicating the direction of the stack layout, either
"horizontal"
or"vertical"
.- type
A string indicating the stack layout type:
"align"
for aligned plots (stack_align()
) or"free"
for free stacking (stack_free()
).- ...
Additional arguments passed to
fortify_data_frame()
orfortify_matrix()
.
Examples
set.seed(123)
small_mat <- matrix(rnorm(56), nrow = 7L)
stack_layout(small_mat, "h", "align") + align_dendro()
# ggstack is an alias for `stack_layout`
ggstack(small_mat, "h", "align") + align_dendro()
# this is the same with:
stack_align(small_mat, "h") + align_dendro()