Learn R Programming

ggalign (version 0.0.5)

stack_switch: Determine the active context of stack layout

Description

[Stable]

stack_active is an alias for stack_switch(), which sets what = NULL by default, with additional arguments for backward compatibility.

Usage

stack_switch(sizes = NULL, what = waiver())

stack_active( sizes = NULL, what = NULL, ..., guides = deprecated(), free_spaces = deprecated(), plot_data = deprecated(), theme = deprecated(), free_labs = deprecated() )

Value

A stack_switch object which can be added to stack_layout().

Arguments

sizes

A numeric or a unit object of length 3 indicating the relative heights (for direction = "horizontal") or widths (for direction = "vertical").

what

What should get activated for the stack layout? A single number or string of the plot elements in the stack layout. If NULL, will remove any active context, this is useful when the active context is a quad_layout() object, where any align_*() will be added to the quad_layout(). By removing the active context, we can add align_*() into the stack_layout().

...

These dots are for future extensions and must be empty.

guides

[Deprecated] Please use plot_align() function instead.

free_spaces

[Deprecated] Please use plot_align() function instead.

plot_data

[Deprecated] Please use plot_data() function instead.

theme

[Deprecated] Please use plot_theme() function instead.

free_labs

[Deprecated] Please use plot_align() function instead.

Examples

Run this code
stack_align(matrix(1:9, nrow = 3L), "h") +
    ggheatmap() +
    # ggheamtap will set the active context, directing following addition
    # into the heatmap plot area. To remove the heatmap active context,
    # we can use `stack_active()` which will direct subsequent addition into
    # the stack
    stack_active() +
    # here we add a dendrogram to the stack.
    align_dendro()

Run the code above in your browser using DataLab