Skip to contents

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

Arguments

e1

A caugi_plot object (top plot)

e2

A caugi_plot object (bottom plot)

Value

A caugi_plot object containing the composed layout

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

Examples

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