Retour au classement

thomasp85/patchwork

Rpatchwork.data-imaginist.com

The Composer of ggplots

rstatsggplot2visualizationggplot-extension
Croissance des étoiles
Étoiles
2.6k
Forks
171
Croissance hebdomadaire
Issues
75
1k2k
nov. 2017sept. 2020août 2023juil. 2026
README

patchwork

R-CMD-check CRAN_Release_Badge CRAN_Download_Badge Codecov test
coverage

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 arbitrarily 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 <- ggplot(mtcars) + geom_point(aes(mpg, disp))
p2 <- ggplot(mtcars) + geom_boxplot(aes(gear, disp, group = gear))

p1 + p2

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 <- ggplot(mtcars) + geom_smooth(aes(disp, qsec))
p4 <- ggplot(mtcars) + geom_bar(aes(carb))

(p1 | p2 | p3) /
      p4

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.

Dépôts similaires
qinwf/awesome-R

A curated list of awesome R packages, frameworks and software.

Rrdata-science
6.5k1.5k
multiprocessio/datastation

App to easily query, script, and visualize data from every database, file, and API.

TypeScriptnpmOthersqlmysql
datastation.multiprocess.io
3k112
plotly/plotly.R

An interactive graphing library for R

ROtherrggplot2
plotly-r.com
2.7k643
thomasp85/gganimate

A Grammar of Animated Graphics

ROtherrstatsggplot2
gganimate.com
2k314
dreamRs/esquisse

RStudio add-in to make plots interactively with ggplot2

ROtherrggplot2
dreamrs.github.io/esquisse
1.9k244
geocompx/geocompr

Geocomputation with R: an open source book

ROtherrspatial
r.geocompx.org
1.8k617
EmilHvitfeldt/r-color-palettes

Comprehensive list of color palettes available in R ❤️🧡💛💚💙💜

Rrstatspalette
emilhvitfeldt.github.io/r-color-palettes/
1.7k145
r-spatial/sf

Simple Features for R

ROtherrspatial
r-spatial.github.io/sf/
1.4k301
hrbrmstr/hrbrthemes

:lock_with_ink_pen: Opinionated, typographic-centric ggplot2 themes and theme components

ROtherrrstats
1.4k98
ropensci/drake

An R-focused pipeline toolkit for reproducibility and high-performance computing

RGNU General Public License v3.0reproducibilityhigh-performance-computing
docs.ropensci.org/drake
1.3k130
mitchelloharawild/vitae

R Markdown Résumés and CVs

RGNU General Public License v3.0ozunconf18resume
pkg.mitchelloharawild.com/vitae/
1.3k245
slowkow/ggrepel

:round_pushpin: Repel overlapping text labels away from each other in your ggplot2 figures.

RGNU General Public License v3.0ggplot2cran
ggrepel.slowkow.com
1.3k96