In a previous life, I worked in the world of program evaluation. In this work, I did a lot of surveys. And in these surveys, we often used Likert scales for answer options. For example:
Question: How good is the education at your school? Answers: Very good, good, bad, very bad.
I had learned from data viz experts like Stephanie Evergreen and Ann Emery that data like this is best shown in a diverging bar chart.
At this time, I used Excel for all my visualizations. When I switched to R, I struggled to figure out how to make these charts. It’s taken me a few years, but I’ve finally gotten the hang of making diverging bar charts in ggplot. Here’s my attempt to show how to make diverging bar charts.
And here’s the code to follow along.
There are a few steps to making a diverging bar chart:
- Make your negative responses have negative values
- Adjust your plot labels so that all positive labels show up
- Reorder your bars so they’re in the right order
- Make the order of your legend match the bars
- Use a diverging fill scale that matches the nature of your data
And here’s what you end up with:
It might sound daunting, but once you get the hang of it, you can easily make diverging bar charts in R!