ggcross
resets the layout ordering index of a stack_cross()
. This
allows you to add other align_*
objects to define a new layout ordering
index. Any objects added after ggcross
will use this updated layout
ordering index. This feature is particularly useful for creating tanglegram
visualizations. ggcross()
is an alias of ggcross()
.
Arguments
- mapping
Default list of aesthetic mappings to use for plot. If not specified, must be supplied in each layer added to the plot.
- size
The relative size of the plot, can be specified as a
unit()
. Note that forcircle_layout()
, all size values will be interpreted as relative sizes, as this layout type adjusts based on the available space in the circular arrangement.- no_axes
Logical; if
TRUE
, removes axes elements for the alignment axis usingtheme_no_axes()
. By default, will use the option-"ggalign.align_no_axes"
.- active
A
active()
object that defines the context settings when added to a layout.
ggplot2 specification
ggcross()
initializes a ggplot data
and mapping
.
ggcross()
always applies a default mapping for the axis of the data index
in the layout. This mapping is aes(y = .data$.y)
for horizontal stack
layout (including left and right annotation) and aes(x = .data$.x)
for
vertical stack layout (including top and bottom annotation).
The data in the underlying ggplot
object will contain following columns:
.panel
: The panel for the aligned axis. Refers to thex-axis
for verticalstack_layout()
(including top and bottom annotations), and they-axis
for horizontalstack_layout()
(including left and right annotations)..names
(vec_names()
) and.index
(vec_size()
/NROW()
): Character names (if available) and the integer index of the original data..hand
: a factor indicates the index groups..x
/.y
and.discrete_x
/.discrete_y
: Integer indices forx
/y
coordinates, and a factor of the data labels (only applicable when names exist).
It is recommended to use .x
/.y
, or .discrete_x
/.discrete_y
as the
x
/y
mapping.