Pat shows how to use annotate() and other functions from ggplot2 to create a break in the x-axis of a dot plot with error bars that were generated using stat_summary(). He customizes the appearance using bind_rows, factor, scale_color_manual, scale_fill_manual, coord_cartesian, scale_x_discrete, labs, and theme. You can find the code he developed in this episode at https://www.riffomonas.org/code_club/2024-11-18-broken-axis. The newsletter describing how I would go about generating the figure can be found at https://shop.riffomonas.org/posts/now-that-i-know-how-to-use-annotate-i-can-see-uses-for-it-everywhere.
If you have a figure that you would like to see me discuss in a future newsletter and episode of Code Club, email me at
[email protected]!
Want more practice on the concepts covered in Code Club? You can sign up for my weekly newsletter at https://shop.riffomonas.org/youtube to get practice problems, tips, and insights. If you're interested in purchasing a video workshop be sure to check out https://riffomonas.org/workshops/
Support Riffomonas by becoming a Patreon member!
https://www.patreon.com/riffomonas
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/
If you want to cite this video, please consider citing https://journals.asm.org/doi/10.1128/mra.01310-22
0:00 Introduction
4:07 Creating a dot plot with error bars
11:37 Changing appearance and location of legend
17:16 Putting a break in the x-axis