Need help with patchwork?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

thomasp85
1.9K Stars 139 Forks Other 232 Commits 38 Opened issues

Description

The Composer of ggplots

Services available

!
?

Need anything else?

Contributors list

# 15,020
R
ggplot2
ggplot-...
sed
202 commits
# 166,533
R
Markdow...
Shell
ggplot-...
6 commits
# 243,985
stochas...
Tensorf...
ml
The Jul...
2 commits
# 121,809
R
TeX
ads-b
uber
2 commits
# 328,882
R
Shell
CSS
ggplot-...
1 commit
# 240,995
travis-...
codecov
R
GitHub
1 commit
# 27,690
R
apache-...
rmarkdo...
excel
1 commit
# 306,226
travis-...
R
C
ggplot-...
1 commit
# 210,197
R
CSS
Firefox
pinboar...
1 commit
# 305,709
R
TeX
tidyver...
ggplot-...
1 commit

patchwork

R build
status CRAN\_Release\_Badge CRAN\_Download\_Badge Lifecycle:
experimental Codecov test
coverage <!-- badges: end -->

The goal of

patchwork
is to make it ridiculously simple to combine separate ggplots into the same graphic. As such it tries to solve the same problem as
gridExtra::grid.arrange()
and
cowplot::plot_grid
but using an API that incites exploration and iteration, and scales to arbitrily complex layouts.

Installation

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")

Basic example

The usage of

patchwork
is simple: just add plots together!
library(ggplot2)
library(patchwork)

p1

<!-- -->

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 

<!-- -->

Learn more

patchwork can do so much more. Check out the guides for learning everything there is to know about all the different features:

Code of Conduct

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.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.