How to combine multiple plots in R with cowplot and ggplot2 (CC098)
Channel: Riffomonas Project
Date: 2021-04-30

It is very common for scientific figures to be made up of multiple plots.  In today's episode we'll see how we can combine multiple plots into one figure using functions from the cowplot and ggpplot2 R packages. You will learn how to use plot_grid to make simple and more comlex figure layouts.

Pat will use RStudio and the #cowplot function #plot_grid, #ggplot2, #ggtext and other packages from the tidyverse. The accompanying blog post can be found at https://www.riffomonas.org/code_club/2021-04-28-cowplot.

Do you have a figure that you would like to receive a critique or help improving? Let me know and I'd be happy to arrange a guest appearance!


If you're interested in taking an upcoming 3 day R workshop, email me at riffomonas@gmail.com!

R: https://r-project.org
RStudio: https://rstudio.com
Raw data: https://github.com/riffomonas/raw_data/releases/latest
Workshops: https://www.mothur.org/wiki/workshops

You can also find complete tutorials for learning R with the tidyverse using...
Microbial ecology data: https://www.riffomonas.org/minimalR/
General data: https://www.riffomonas.org/generalR/

0:00 Introduction
2:30 Combining strip chart and ROC curve code
4:33 Creating functions to build ROC curves
6:52 Using plot_grid to make a four panel figure
8:00 Modifying number of columns, rows, and their proportions
11:07 Adding panel labels
12:41 Advanced manipulation of panel configuration
14:22 Advanced panel labels w/ geom_richtext
18:52 Recap