11.46 Multiple Plots in a Single Plot

20220515 patchwork (Pedersen 2022) supports combining individual plots into a single plot.

The + operator is used to arrange plots into a grid, aiming to keep the grid square and filling it out in row order.

p1 + p2 + p3 + p4

Of course, that can all be changed. Here the patchwork::plot_layout() is used to arrange the plots across three rows, filling the columns first:

p1 + p2 + p3 + p4 + plot_layout(nrow = 3, byrow = FALSE)

The / operator is used to stack plots.

p1 / p2 / p3 / p4

See [https://patchwork.data-imaginist.com/articles/patchwork.html] for details.


Pedersen, Thomas Lin. 2022. Patchwork: The Composer of Plots. https://CRAN.R-project.org/package=patchwork.

Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0