Customizing axes in a 1D scatter plot using the ggplot2 package in R (CC305)
Riffomonas Project Riffomonas Project
22K subscribers
574 views
57

 Published On Oct 14, 2024

Pat recreates a scatter plot that has a missing x-axis using the geom_point function from ggplot2 in R using geom_point. He customizes the appearance to match the original figure using the geom_vline, geom_hline, scale_color_manual, scale_x_continuous, scale_y_continuous, labs and theme functions. You can find the code I develop in this episode at https://www.riffomonas.org/code_club/....

The plot is is Figure 1A from the paper, "Exploring novel microbial metabolites and drugs for inhibiting *Clostridioides difficile*" by Ahmed Abouelkhair and Mohamed Seleem (https://journals.asm.org/doi/10.1128/....

The newsletter describing how I would go about generating the figure can be found at https://shop.riffomonas.org/posts/bui....

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!
  / 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/...

0:00 Introduction
6:34 Generating base scatter plot
8:37 Adding color to the plot
13:04 Removing x-axis
15:37 Adding horizontal lines
18:38 Customizing y-axis
23:39 Getting points to fall on top of axis line

show more

Share/Embed