ggcross {ggalign} | R Documentation |
Connect two layout crosswise
Description
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()
.
Usage
ggcross(mapping = aes(), size = NULL, no_axes = NULL, active = NULL)
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
|
no_axes |
|
active |
A |
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.