Hey folks, I hope you all are doing well as we settle in to 2025. Here in southeastern Michigan winter has settled in. Our high temperatures have been below freezing for the past week and it looks like they will be for at least the next 10 days. Brrrr. Going outside reminds me to be grateful that our furnace works and that we’re able to keep it running. It’s easy to take that for granted. Perhaps this is what people had in mind when they made January, “National Poverty in America Awareness Month”. Looking through the US Census Bureau’s poverty report from last January, I was struck by their Figure 1. The data has a column for the year, the number of people in poverty, and the percentage of people in poverty. We can see that the “War on Poverty”, which started in 1964, continued the downward trend in the rate of poverty. Unfortunately, the rate has oscillated between 10 and 15% for the past 50 years without a further reduction. Beyond the stories the figure tells, I thought there were a number of interesting components to this figure that would be fun to consider in R. First, this is clearly a pair of line plots with the top panel showing the number of people and the bottom panel showing the fraction of people living in poverty by year. We could do this with Second, of course, the top and bottom panels are different colors. But if we’re going to use Third, I noticed that they highlighted when recessions have occurred for the past 65 years. I’m not sure what I’m supposed to see linking recessions to poverty, but they included the information. We can get those dates from Wikipedia. I’d likely generate those light blue rectangles using Fourth, I like how the authors put the number and rate for 2022 in the right-hand margin of the plot. We could pull this off with Fifth, there are several things that we’ve seen recently that we could reimplement here. A few weeks ago we saw a legend with a single variable in it. This figure also has a single variable legend. I think it is useful here. Having the glyph for the fill color to indicate that the color represents when recessions occurred is pretty nice. Also, I’m pretty sure they’re using Libre Franklin as their sans serif font. We could use that font with help from the What don’t I like about this figure? Well, they have a broken y-axis for the number of people in poverty. I think that’s deceiving and not necessary. I’d either leave it “unbroken” or start the y-axis with 20 million. The only time you really need to include zero on the y-axis is for a bar plot. I also find it really challenging to vertically line things up between the two panels. I think vertical grid lines would make things busy. But what if we put major tick marks every five years and shorter tick marks on the individual years? Or what if we dropped them entirely? Finally, I notice that the last year on the x-axis is 2022, which makes sense because it’s the final year. But that creates a weird gap between 2015 and 2022. With longer tick marks every five years, I think it would then become obvious from the smaller tick marks that the plot ends in 2022. Plus it would be in the title. Let me know what you like or don’t like about this figure! Looking at the other figures in the report, which would you like to see me recreate with {ggplot2}?
|
Hey folks, If you’re interested in participating in a 1-day (6 hours) data visualization workshop, you’re running out of time to register. I’ll be teaching this workshop on May 9th. I will cover an introduction to the ggplot2 package and will assume no prior R knowledge. My goal is to help you to understand the ggplot2 framework and begin to apply it to make some interesting and compelling visualizations. After this workshop, you should be able to learn more advanced topics on your own. You...
Hey folks, I’m gearing up to teach a 1-day (6 hours) data visualization workshop on May 9th. This workshop will cover an introduction to the ggplot2 package and will assume no prior R knowledge. My goal is to help you to understand the ggplot2 framework and begin to apply it to make some interesting and compelling visualizations. From this workshop, I hope that you would be able to go off on your own journey learning more advanced topics. You can learn more and register by clicking the button...
Hey folks, Long time friends of Riffomonas know that I’ve been teaching data science classes for close to 20 years. The hallmark of my teaching has been three-day workshops where I either teach R (here and here) or the mothur software package. I’ve gotten feedback that three days is just too much time for people to carve out of their busy schedules. So, I’m excited to be offering a 1-day (6 hours) data visualization workshop on May 9th. This will cover an introduction to the ggplot2 package....