MENU

Fun & Interesting

Using ggplot2 and R to recreate a data journalist's figure about Michigan wages (CC321)

Riffomonas Project 872 5 months ago
Video Not Working? Fix It Now

Pat recreates a journalist's figure from Bridge Michigan about the increase in Michigan wages using ggplot2. He'll show how to you can use ggplot2 functions to make a barplot with a customized x and y-axis, legend, and titles. He used geom_col, geom_text, annotate, scale_fill_manual, coord_cartesian, labs, and theme functions from R's ggplot2. You can find the code he developed in this episode at https://www.riffomonas.org/code_club/2024-12-02-wages-barplot. The newsletter describing how he would go about generating the figure can be found at https://shop.riffomonas.org/posts/reverse-engineering-a-dilution-series-of-box-plots. 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 3:58 Building bar plot with titles 11:08 Formatting titles 16:16 Styling legend text and glyph 20:06 Adding text to interior of bars 24:26 Styling x-axis text and ticks 31:07 Styling y-axis text and ticks

Comment