Learn R Programming

caugi (version 1.0.0)

divide-caugi_plot-caugi_plot: Compose Plots Vertically

Description

Stack two plots vertically with configurable spacing. Compositions can be nested to create complex multi-plot layouts.

Value

A caugi_plot object containing the composed layout

Arguments

e1

A caugi_plot object (top plot)

e2

A caugi_plot object (bottom plot)

Details

The spacing between plots is controlled by the global option caugi_options()$plot$spacing, which defaults to grid::unit(1, "lines"). Compositions can be nested arbitrarily:

  • p1 / p2 - two plots stacked vertically

  • p1 / p2 / p3 - three plots in a column

  • (p1 + p2) / p3 - two plots on top, one below

See Also

caugi_options() for configuring spacing and default styles

Other plotting: add-caugi_plot-caugi_plot, caugi_layout(), caugi_layout_bipartite(), caugi_layout_fruchterman_reingold(), caugi_layout_kamada_kawai(), caugi_layout_sugiyama(), caugi_layout_tiered(), caugi_plot(), plot()

Examples

Run this code
cg1 <- caugi(A %-->% B, B %-->% C)
cg2 <- caugi(X %-->% Y, Y %-->% Z)

p1 <- plot(cg1, main = "Graph 1")
p2 <- plot(cg2, main = "Graph 2")

# Vertical composition
p1 / p2

# Mixed composition
(p1 + p2) / p1

Run the code above in your browser using DataLab