• Stars
    star
    2,431
  • Rank 18,920 (Top 0.4 %)
  • Language
    R
  • License
    Other
  • Created almost 7 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The Composer of ggplots

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.

More Repositories

1

gganimate

A Grammar of Animated Graphics
R
1,935
star
2

ggraph

Grammar of Graph Graphics
R
1,063
star
3

ggforce

Accelerating ggplot2
R
915
star
4

tidygraph

A tidy API for graph manipulation
R
545
star
5

ggplot2_workshop

Material for "Drawing Anything with ggplot2" workshop
491
star
6

lime

Local Interpretable Model-Agnostic Explanations (R port of original Python package)
R
480
star
7

scico

Palettes for R based on the Scientific Colour-Maps
R
409
star
8

tweenr

Interpolate your data
R
399
star
9

fiery

A flexible and lightweight web server
R
242
star
10

shinyFiles

A shiny extension for server side file access
JavaScript
195
star
11

ggfx

Filters and Shaders for 'ggplot2'
R
166
star
12

densityClust

Clustering by fast search and find of density peaks
R
150
star
13

farver

High Performance Colourspace Manipulation in R
R
127
star
14

particles

A particle simulation engine based on a port of d3-force
R
118
star
15

transformr

Smooth Polygon Transformations
R
115
star
16

ambient

A Generator of Multidimensional Noise
R
93
star
17

euclid

Exact Computation Geometry Framework Based on 'CGAL'
C++
82
star
18

routr

Routing of Web Requests in R
R
55
star
19

hierarchicalSets

Scalable Set Visualization using Hierarchies
R
54
star
20

Hr

Easy Access to Uppercase H
R
53
star
21

reqres

Powerful classes for http requests and responses
R
36
star
22

curry

Partial Function Application with %<%, %-<%, and %><%
R
30
star
23

FindMyFriends

Fast alignment-free pangenome creation and exploration
R
27
star
24

pipeplotter

Syntactic ggplot2 Sugar for a Tidy World
R
26
star
25

fawkes

An R Interface to the AxiDraw plotter
R
25
star
26

pearls

Operations on Lists of Data Frames
R
18
star
27

PanVizGenerator

Create your own PanViz visualizations
R
18
star
28

ink

The Modern, High-Performant, Graphic Device for R
C++
17
star
29

ggplot2_mechanics

The Mechanics of ggplot2
TeX
16
star
30

plotting_benchmark

Investigating R graphics performance
HTML
16
star
31

grid

personal devel version of grid
R
15
star
32

PanViz

D3 based visualisation for comparative genomics
JavaScript
14
star
33

boundaries

Algorithms for Working With and Modifying Polygon Boundaries
C++
13
star
34

data_imaginist

data_imaginist source
HTML
12
star
35

nanodev

Graphic Devices for R based on NanoVG
C
10
star
36

MSGFgui

A gui overlay and extension for MSGFplus
R
10
star
37

orion

Spatial Searching for Euclid
C++
9
star
38

web_dev_in_R

Web Development for R Users
TeX
9
star
39

heroku-fiery-demo

A demo fiery application for deployment on Heroku
R
8
star
40

unmeshy

A Vector Based 3D Renderer
C++
7
star
41

MSsary

Mass spectrometry data in R
R
7
star
42

RcppSNAP

'Rcpp' Integration for the SNAP Network Library
C++
6
star
43

tidy_graph_analysis

Tidy Network Analysis in R
TeX
6
star
44

polyclid

Polygon Support for Euclid
C++
6
star
45

mzID

An mzIdentML parser for R
R
6
star
46

MSGFplus

An MSGF+ interface for R
R
6
star
47

thomasp85.github.io

The source for data-imaginist.com
HTML
6
star
48

mvpcran

CRAN on a stick
R
5
star
49

shady

Compile and Execute Shaders from R
C++
5
star
50

anomaly

Detecting those outliers
R
4
star
51

firedock

Dockerfiles for fiery
R
4
star
52

phd_dissertation

Pangenome Tools for Rapid, Large-Scale Analysis of Bacterial Genomes
TeX
4
star
53

d3Disco

A showcase for Shiny and D3 integration
JavaScript
4
star
54

pepmaps

R package for quantitative peptidomics
R
2
star
55

masochist

For some reason Iā€™m doing all of this from my phone
R
2
star
56

firedock_test

R
1
star
57

Biotools

Scripts for CMG-Biotools
Perl
1
star
58

firesafety

Security for fiery apps
1
star
59

circosScripts

Perl scripts to automate circos plots
Perl
1
star
60

CHtools

A list of diverse functions for CH
R
1
star