Skip to contents

[Stable]

This function integrates the functionalities of stack_discrete() and stack_continuous() into a single interface.

Usage

stack_layout(direction, data = NULL, ..., limits = waiver())

stack_horizontal(data = NULL, ..., limits = waiver())

stack_vertical(data = NULL, ..., limits = waiver())

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:

  • If limits is not provided, fortify_matrix() will be used to get a matrix.

  • If limits is specified, fortify_data_frame() will be used to get a data frame. Note that if the data is a matrix, it will be automatically converted to a long-formatted data frame, which differs from ggplot2'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.

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_discreteh(small_mat) + align_dendro()


# For vertical layout:
stack_vertical(small_mat) + align_dendro()