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! The summer is nearly over - where did it go?! Many of us are getting ready to send our kids off to school and start a new academic year. If you’re subscribed to this newsletter, I suspect you are interested in improving your data visualization skills. You can certainly continue to receive this newsletter and watch my weekly livestreams on YouTube for free to help increase those skills. If you want a more concentrated or personalized opportunity to develop your data visualization...

Hey folks! I’d love to have you join me in September for a new approach to teaching workshops that I will be rolling out. For five weeks I’ll be working with two cohorts of you all to improve our data visualization skills. Each week we’ll meet for a two-hour session. These sessions will include instruction on principles and concepts in data visualization and an opportunity to apply this information to visualizations we find in the wild or that you bring to the group. By not talking about...

Hey folks, Are you interested in uping your data visualisation skills? I’m rolling out a new program to help you improve the design of your data visualizations. This program will last 5 weeks starting at the beginning of September. Each session will be two hours long and include a discussion of data visualization principles followed by an opportunity to apply these ideas to your own visualizations. There will be no coding in this program so you can focus more on concepts than implementation....