Visualize this: If you support something do you actually want it done?


Hey folks!

Sorry for the hiatus in getting you a newsletter into your inbox. The end of the summer/beginning of the academic year has been pretty chaotic. Actually, I had what I thought would be an interesting plot to recreate, but then I wasn’t able to find the original data and I wasn’t really interested in simulating it. Oh well. I’m also finding it hard to come up with interesting data visualizations from out in the wild. One of my go-to’s, Philip Bump, stopped working for the Washington Post and isn’t putting out a newsletter anymore either. So… if you come across any interesting plots - anywhere - feel free to send them my way!


As much as I’m sure you all are sick of seeing plots from the NY Times, I have another one for you this week (see my plea above…). The New York Times and Siena conducted a poll last week where they asked New Yorkers a variety of questions. Nate Cohn wrote up an analysis comparing the difference between NYers support for a policy versus them thinking New York City should implement a policy. The upshot of the results is that on most policies people are more likely to support the policy rather than want to see it enacted. He shares this seemingly simple bar plot.

How would you go about making this in R using tools from the tidyverse? What stands out to you as being something you’re not sure how you would do? What do you think is cool about the plot?

I’m thinking I would start with a tibble that has three columns. The first would be the title of the policy (e.g., “Add 5,000 police officers”), the second would be the “Support” and “N.Y.C. should do this” question category, and the third column would be the percent of respondents who were affirmative.

To create a bar plot, I would use geom_col(). I’d map the affirmative to the x-axis, the policy to the y-axis, and the question to the fill color. By putting the `affirmative on the x-axis, we get the horizontal, rather than typical vertical layout. I like the horizontal because it’s easier to read the text left to right than from bottom to top.

You might be saying, “But Pat the policy title is in between the sets of bars rather than to the left of them like a bar plot!” You’re correct. Let’s think about how to fix this. I could see increasing the space between the pairs of bars and then doing some margin() magic to put the titles on top of the pair. I think this would work. But, I think it would be a lot easier to use facet_wrap(~policy) with ncol = 1. Then the policy title would go in the facet’s strip. With some theme() work we could get it to match the appearance in the plot. If we left the policy being mapped to the y-axis, we’d need to use scales = "free_y" so each facet only had one policy per facet. Alternatively, we could map question to both the y-axis and the fill color.

Instead of an explicit x-axis to tell us the affirmative value, they put the numbers off to the right side of the bars. I’d add the text with geom_text(). I’d use the nudge_x argument to nudge the numbers to the right a smidge.

Instead of a legend, the plot has the text of “Support” and “N.Y.C. should do this” within each of the bars. Again, I’d use geom_text(), but instead of mapping affirmative to the x-axis, I’d set x = 0 to put the question value to the left side of the bars.

Finally, I’m a sucker for putting legend information in titles. Here they matched the color of the text in the subtitle to the fill color of the bars. I’d do this with element_markdown from the {ggtext} package. It appears the colored text is bold, so I’d be sure to add some CSS code to emphasize and color the question values in the subtitle.

What do you think? Have ideas on how to do it differently? Give this plot a try on your own and then when I livestream it, you can see how our approaches compare.

Again, if you have suggestions for plots to recreate, please send them my way by replying to this email!Hey folks!
Sorry for the hiatus in getting you a newsletter into your inbox. The end of the summer/beginning of the academic year has been pretty chaotic. Actually, I had what I thought would be an interesting plot to recreate, but then I wasn't able to find the original data and I wasn't really interested in simulating it. Oh well. I'm also finding it hard to come up with interesting data visualizations from out in the wild. One of my go-to's, Philip Bump, stopped working for the Washington Post and isn't putting out a newsletter anymore either. So... if you come across any interesting plots - anywhere - feel free to send them my way!

Workshops

I'm pleased to be able to offer you one of three recent workshops! With each you'll get access to 18 hours of video content, my code, and other materials. Click the buttons below to learn more

In case you missed it…

Here is a livestream that I published this week that relate to previous content from these newsletters. Enjoy!

video preview

Finally, if you would like to support the Riffomonas project financially, please consider becoming a patron through Patreon! There are multiple tiers and fun gifts for each. By no means do I expect people to become patrons, but if you need to be asked, there you go :)

I’ll talk to you more next week!

Pat

Riffomonas Professional Development

Read more from Riffomonas Professional Development

Hey folks! This week I have a figure for you from the New York Times based on a poll they did with Siena that describes Americans’ sentiments concerning Israel’s actions in their war with Gaza. What does it say to me? This plot is saying that more Americans think that Israel is intentionally killing civilians than they did in December 2023. The change in percentage of people in the other categories seems to decrease accordingly. What do you like? I love slope plots! I think they’re a great...

Hey folks, This week I have an interesting figure for you from the Financial Times from an e-mail newsletter they distribute each week describing some visualization related to climate change. Before reading further, go ahead and spend a few minutes with the image. What does it say to you? What do you like? What don’t you like about it? How do you think you would go about making it in R? I’d encourage you to write down any of your answers to these questions before reading what I have to say....

Hey folks! I’m in proposal writing mode again. Unfortunately, I am finding my weekly search for a data visualization to share with you is leading me down unproductive internet rabbit holes. So, I thought I’d share an idea with you that I hope resonates. If you have any reactions, please send them my way! For the past year or so I have been recreating other people’s data visualizations in an attempt to learn new techniques with R and expand the type of data that I normally visualize. The idea...