The Composer of ggplots
The goal of
patchworkis to make it ridiculously simple to combine separate ggplots into the same graphic. As such it tries to solve the same problem as
cowplot::plot_gridbut using an API that incites exploration and iteration, and scales to arbitrily complex layouts.
You can install patchwork from CRAN using
install.packages('patchwork'). Alternatively you can grab the development version from github using devtools:
# install.packages("devtools") devtools::install_github("thomasp85/patchwork")
The usage of
patchworkis simple: just add plots together!
patchwork provides rich support for arbitrarily complex layouts with full alignment. As an example, check out this very readable code for nesting three plots on top of a third:p3
patchwork can do so much more. Check out the guides for learning everything there is to know about all the different features:
Please note that the patchwork project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.