How to combine multiple plots in R with cowplot and ggplot2 (CC098)

Riffomonas Project April 30, 2021
Video Thumbnail
Riffomonas Project Logo

Riffomonas Project

View Channel

About

I'm Pat Schloss! I produce videos about how to use data science tools to answer questions about the world around me. I believe that anyone can answer their own questions. Do you?! I'd love to learn more about the world around you. Share the questions you would like to answer and we can take them on together!

Video Description

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 [email protected]! 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

You May Also Like

Craft Essentials for Easy Projects

AI-recommended products based on this video

Loading...
Mibly [125 Count] 6 Inch Jumbo Multipurpose wooden Popsicle sticks, Wood Craft Supplies, Lollipop Lolly Sticks, Wooden Tongue Depressor, Wax Sticks for Waxing, Ice Cream Sticks

Mibly [125 Count] 6 Inch Jumbo Multipurpose wooden Popsicle sticks, Wood Craft Supplies, Lollipop Lolly Sticks, Wooden Tongue Depressor, Wax Sticks for Waxing, Ice Cream Sticks

(110)
$6.29
FREE delivery Thu, Sep 11 on your first order
800+ bought in past month
Loading...
202pcs Press on Nail Packaging Bag, 100pcs Empty Holographic Nail Storage Bag and 100pcs Instruction&Display Black Cardboard with 2 Roll Transparent Tape for Nail Display Profession Salon(Pink)

202pcs Press on Nail Packaging Bag, 100pcs Empty Holographic Nail Storage Bag and 100pcs Instruction&Display Black Cardboard with 2 Roll Transparent Tape for Nail Display Profession Salon(Pink)

(0)
$18.99
FREE delivery Wed, Aug 20 on your first order
Loading...
Scotch Heavy Duty Shipping Packaging Tape, 1 Roll with Dispenser, 1.88" x 22.2 Yards, 1.5" Core, Great for Packing, Shipping & Moving, Clear (142)

Scotch Heavy Duty Shipping Packaging Tape, 1 Roll with Dispenser, 1.88" x 22.2 Yards, 1.5" Core, Great for Packing, Shipping & Moving, Clear (142)

(4,134)
$5.98
FREE delivery Sat, Jun 14 on your first order
1K+ bought in past month
Loading...
Scotch Tape Gift Wrap Tape, 19mm Wide x 10.1m, 3 Rolls in Dispensers

Scotch Tape Gift Wrap Tape, 19mm Wide x 10.1m, 3 Rolls in Dispensers

(5,812)
$6.96
FREE delivery Mon, Sep 15 on your first order
4K+ bought in past month
Loading...
Scotch Packaging Tape, 1.88 in x 54.6 yd (48 mm x 50 m), 1 Roll, Secure Seal
Best Seller

Scotch Packaging Tape, 1.88 in x 54.6 yd (48 mm x 50 m), 1 Roll, Secure Seal

(360)
$4.25
FREE delivery Sat, Jun 14 on your first order
2K+ bought in past month
Loading...
MUCCA 3Pcs Necklaces for Women Layered Gold Necklace for Women Classic Gold Plated Chain Stackable Trendy Cuban Link Paperclip Chains Sets for Beach Daily Wear

MUCCA 3Pcs Necklaces for Women Layered Gold Necklace for Women Classic Gold Plated Chain Stackable Trendy Cuban Link Paperclip Chains Sets for Beach Daily Wear

(3)
$15.39
FREE delivery Thu, Sep 4 on your first order
100+ bought in past month
Loading...
LEGO Icons Williams Racing FW14B & Nigel Mansell F1 Model Car Kit - Building Set for Adults, Ages 18+ - F1 DIY Craft for Display - Gift Idea for Fans of F1-10353

LEGO Icons Williams Racing FW14B & Nigel Mansell F1 Model Car Kit - Building Set for Adults, Ages 18+ - F1 DIY Craft for Display - Gift Idea for Fans of F1-10353

(40)
$89.99
PrimeFREE delivery Sat, Jun 14
200+ bought in past month
Loading...
LEGO Icons Leonardo da Vinci's Flying Machine DIY Kit - Ornithopter Building Set for Adults, Ages 18+ - Craft for Home or Office Decor with Display Stand - Gift Idea - 10363

LEGO Icons Leonardo da Vinci's Flying Machine DIY Kit - Ornithopter Building Set for Adults, Ages 18+ - Craft for Home or Office Decor with Display Stand - Gift Idea - 10363

(185)
$49.98
PrimeFREE delivery Sat, Jun 14
200+ bought in past month
Loading...
DIY Wall Collage Kit for Teen & Tween Girls - Perfect Craft Gift Ideas for 10, 11, 12,13, 14, 15 Year Old Girl - Trendy Birthday Gifts and Stuff for Teenage Bedroom - Fun Teens Crafts Kits Age 8+

DIY Wall Collage Kit for Teen & Tween Girls - Perfect Craft Gift Ideas for 10, 11, 12,13, 14, 15 Year Old Girl - Trendy Birthday Gifts and Stuff for Teenage Bedroom - Fun Teens Crafts Kits Age 8+

(1,654)
$28.01
FREE delivery Sat, Jun 14 on your first order
200+ bought in past month
Loading...
Purple Ladybug Decorate Your Own Water Bottle for Kids Craft Kits - DIY Unicorn Girls Gifts 8-12 Years Old, Arts and Crafts for Girls Age 8-10 - Fun Travel Activities for Kids

Purple Ladybug Decorate Your Own Water Bottle for Kids Craft Kits - DIY Unicorn Girls Gifts 8-12 Years Old, Arts and Crafts for Girls Age 8-10 - Fun Travel Activities for Kids

(31,188)
$15.99
FREE delivery Sat, Jun 14 on your first order
50+ bought in past month
Loading...
HONYUEYIM 2 PCS Magnetic Couples Bracelets for Women Men,Natural Stone Stone Beads Bracelet His and Hers Relationship Bracelet for Boyfriend Girlfriend Valentines Day Gifts (Purple + Black)

HONYUEYIM 2 PCS Magnetic Couples Bracelets for Women Men,Natural Stone Stone Beads Bracelet His and Hers Relationship Bracelet for Boyfriend Girlfriend Valentines Day Gifts (Purple + Black)

(7)
$22.79
FREE delivery Sun, Jul 6 on your first order
Loading...
Downy Unstopables Unlimited Collection In-Wash Laundry Scent Booster Beads, No. 37, Fine Fragrance and All - Day Freshness, 303 g

Downy Unstopables Unlimited Collection In-Wash Laundry Scent Booster Beads, No. 37, Fine Fragrance and All - Day Freshness, 303 g

(7)
$10.99
FREE delivery Thu, Nov 27 on your first order
200+ bought in past month
Loading...
Floral Beads Kit 50000pcs & 300pcs Giant Large Colorful Gel Jelly Balls, Non Toxic Beads for Vase Filler, Plant, Floating Candles, Wedding and Home Decoration

Floral Beads Kit 50000pcs & 300pcs Giant Large Colorful Gel Jelly Balls, Non Toxic Beads for Vase Filler, Plant, Floating Candles, Wedding and Home Decoration

(2)
$15.99
FREE delivery Sat, Nov 22 on your first order
Loading...
Gifts 5-12 Years Old Girls, Bracelet Making Kit, Unicorn Toys, Gifts for Teen Girls, Beads for Making Jewellery, Crafts for Kids 6-8, Arts and Crafts for Kids Age 4 5 6 7 8 9 10 11

Gifts 5-12 Years Old Girls, Bracelet Making Kit, Unicorn Toys, Gifts for Teen Girls, Beads for Making Jewellery, Crafts for Kids 6-8, Arts and Crafts for Kids Age 4 5 6 7 8 9 10 11

(455)
$19.98
FREE delivery Sat, Jun 14 on your first order
400+ bought in past month
Loading...
Expandable Garden Hose Set 100FT Upgraded Flexible Water Hose 3/4" Solid Brass Fittings with 10 Function Sprayer Nozzle Gardening Flexible Hose Pipe with Storage Bag Red

Expandable Garden Hose Set 100FT Upgraded Flexible Water Hose 3/4" Solid Brass Fittings with 10 Function Sprayer Nozzle Gardening Flexible Hose Pipe with Storage Bag Red

(51)
$35.19
FREE delivery Tue, Jul 1
500+ bought in past month