Hey folks, I hope you enjoyed thinking last week about how you would recreate Plate 12 from the WEB DuBois collection of visuals he showed at the 1900 Paris Exhibition using ggplot2 and related R tools. You can find the entire collection of “data portraits” in a book assembled by Whitney Battle-Baptiste and Britt Rusert (here) or as a collection of plates through the Library of Congress (here). I won’t reshare all the resources describing the collection, but do encourage you to check out last week’s newsletter. As you look through those data portraits, you might wonder, “Why would Pat suggest we think about how to generate these figures? A lot of what’s in them people tell us are bad practices.” There are a few reasons. First, my original motivation behind recreating other people’s figures was taken from seeing my son’s replications of other artworks. Those recreations are done to help artists explore their technique. I thought we could do the same with data visualization. If I only ever make line plots, that look like something generated with ggplot2, then I’ll never develop the skills to make scatter plots or do weird things with axis titles, or use my own font choices. I can’t tell you how much I’ve learned about R over the past 6 months by recreating the visuals we have covered. Are they all great visuals? No. But by trying to faithfully recreate them, my technique has really developed. The DuBois data portraits are radically different from the types of plots we make. My understanding is that was intentional. Imagine walking by a poster at a conference with plots that look wildly different from everyone else. You’ll get my attention and I’ll be more likely to stop and have a look. That was what DuBois was trying to do in Paris. He wanted people to stop and see a story about the life of Black people in the US in 1900. There were a lot of negative stories being told by others, but he wanted to tell his own community’s story. So there’s value in learning to make plots that are radically different, because it will force us to use our tools to do unconventional things. In the process we’ll learn to use our tools better. Consider Plate 27... Before you clutch your pearls and shriek, “PIE CHART!”, give it some time. Again, there are other ways of presenting the same data - how would you present them? Later you could try that on your own. Let’s try to do it like DuBois did. Here are the data:
As always, a few things stand out to me that would direct my approach to recreating this “fan plot”. First, it’s a pie chart. Pie charts are best thought of as stacked bar charts drawn in polar coordinates. Something I’ve learned working with polar coordinates is to get things looking right in Cartesian coordinates before pivoting it to polar. It’s too hard to wrap my mind around what’s going on in polar coordinates. We’ll want a single stacked bar. To remove the pie pieces that are on the side, I’d insert a fake category that is about 60% for both races. Later, we can make this transparent or the color of the background. When we convert this to a pie chart, we’ll use Second, something to consider is that if the occupation category is mapped to the fill, then the same category in each race will get merged if we set Third, with a “fake” category to provide space on the sides, we’ll have 12 category-race combinations. We’ll want to use Fourth, there are two types of labels. We can add the numeric labels using Fifth, I love incorporating subtle points in figures. I noticed that both fans have a black line as their edge. Of course the fake category shouldn’t have an edge. I think we can pull this off using At each stage, I’d encourage you to see what the plot looks like in both coordinate systems by flipping back and forth between Finally, if you thought this was fun, I’d encourage you to check out Plate 22. How would you go about generating that unique “bulls eye plot”?
|
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....