Plot Composition in ggplot

By Robin Browne | December 29, 2017

I recently came across a tweet by Mara Averick where she talked about patchwork, a library to help you arrange your ggplot outputs.

A Basic Example

From Thomas’ Github page:

Load Library
  library(ggplot2)
  library(patchwork)
  library(dplyr)
Output
  p1 <- ggplot(mtcars) + geom_point(aes(mpg, disp))
  p2 <- ggplot(mtcars) + geom_boxplot(aes(gear, disp, group = gear))

  p1 + p2