Skip to contents

[Stable]

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 of stack_free that sets direction = "v".

  • stack_continuoush()/stack_freeh: A special case of stack_free that sets direction = "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 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.

theme

A theme() object used to customize various elements of the layout, including guides, title, subtitle, caption, margins, panel.border, and background. By default, the theme will inherit from the parent layout. It also controls the panel spacing for all plots in the layout.

sizes

A numeric value or a unit object. When used for the quad_layout() annotation, it must be of length 1. When used in the stack_layout() with a nested quad_layout(), it should be of length 3, specifying the relative heights (for direction = "h") or widths (for direction = "v") to be applied to the layout.