| add-caugi_plot-caugi_plot | R Documentation |
Arrange two plots side-by-side with configurable spacing. The + and |
operators are equivalent and can be used interchangeably. Compositions can
be nested to create complex multi-plot layouts.
## S3 method for class 'caugi_plot'
e1 + e2
## S3 method for class 'caugi_plot'
e1 | e2
e1 |
A |
e2 |
A |
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 side-by-side
(p1 + p2) + p3 - three plots in a row
(p1 + p2) / p3 - two plots on top, one below
A caugi_plot object containing the composed layout
caugi_options() for configuring spacing and default styles
Other plotting:
caugi_layout(),
caugi_layout_bipartite(),
caugi_layout_circle(),
caugi_layout_fruchterman_reingold(),
caugi_layout_kamada_kawai(),
caugi_layout_sugiyama(),
caugi_layout_tiered(),
caugi_plot(),
divide-caugi_plot-caugi_plot,
plot.caugi()
cg1 <- caugi(A %-->% B, B %-->% C)
cg2 <- caugi(X %-->% Y, Y %-->% Z)
p1 <- plot(cg1, main = "Graph 1")
p2 <- plot(cg2, main = "Graph 2")
# Horizontal composition
p1 + p2
p1 | p2 # equivalent
# Adjust spacing
caugi_options(plot = list(spacing = grid::unit(2, "lines")))
p1 + p2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.