Skip to contents

Accept mixed inputs supported by as_forma() and lay out the resulting graphics with patchwork::wrap_plots(). The layout arranges outer cells. Data panel alignment within wrapped graphics depends on the original plots' margins.

Usage

ggassemble(
  ...,
  plots = NULL,
  ncol = NULL,
  nrow = NULL,
  byrow = NULL,
  widths = NULL,
  heights = NULL,
  design = NULL
)

Arguments

...

Graphics to adapt or a single unnamed list of graphics. Names can identify corresponding areas in a patchwork design string.

plots

Optional list of graphics. Supply either plots or individual graphics in ....

ncol, nrow

Number of columns and rows.

byrow

Fill cells by row when true and by column when false.

widths, heights

Relative column widths and row heights.

design

A patchwork design string or a vector of patchwork::area()s.

Value

A patchwork that can receive plot_layout(), plot_annotation(), theme changes and other native patchwork operations.

Examples

p <- ggplot2::ggplot(mtcars, ggplot2::aes(wt, mpg)) + ggplot2::geom_point()
ggassemble(A = grid::textGrob("Fuel economy"), B = p, design = "A\nB") +
  patchwork::plot_annotation(tag_levels = "A")