Making a Bad Graph Less Bad
By: Eileen Palmer
Tags: Data Visualization, Data, Data Science, Matplotlib, Python

Storytelling is one of the important ways humans communicate with one another. To tell stories about data, we use data visualizations, or more simply put — graphs.

There are some terrible graphs out there, and we’ve all seen them. But there are even more graphs that aren’t quite terrible, but are bad nonetheless.

Scrolling through my Facebook feed the other day, I came across an article from the South Florida Sun Sentinel about the politics of guns. The leading data visualization caught my eye — but not in a good way. The colors were bothersome, things were too far apart to make visual comparisons, and the style of graph was less than ideal.

Here’s the graphic:

Graphic from article in South Florida Sun Sentinel

Let’s take a closer look at what makes this graph bad and see if we can make it less bad.

Color

One of the first things I noticed about the visual was the bad choice of colors. While at first it might make sense to represent “Support” with green and “Oppose” with red (like the colors of a traffic light), this color combo should be avoided — and for a very good reason. It is widely known that the most common type of colorblindness is red-green colorblindness, that is those affected cannot (or have difficulty) distinguishing between red and green. If you cannot tell the difference between these two colors, this graphic is useless, or confusing at best. With 1 in 12 men and 1 in 200 women affected by colorblindness, the red-green combination is a bad choice.

I started imagining what the graph might look like with other color combinations. My first thought was: what about blue and orange? This is a commonly used pairing for data visualizations, mainly because it’s easy on the eyes, so to speak. But I let out a sigh of disappointment when I realized blue-orange would not work for this graph. The data being represented have to do with level of support for an assault-style weapons ban, an undeniably political topic. Since blue is typically used for the Democratic party and red for the Republican party, using either of those colors is a bad idea. While it is true that a democrat is more likely to be a supporter and a republican an opposer, it’s not a good plan to imply by color usage that these things always go hand-in-hand.

So if I can’t use red or blue, what’s left? I probably want to stay within the Crayola 8, as outside colors can sometimes be distracting, so let’s try green and orange. Aesthetically, it’s not my favorite choice — but it’s better than bad.

Comparison

The figure is begging the viewer to make visual comparisons, but it’s not always easy to do. In the figure, there are three related graphs. The top graph illustrates the proportion of all Floridians who support and oppose an assault-style weapons ban, as well as those who don’t know or have no answer. It is meant to be a point of comparison for the other two graphs, which display the proportions for support, oppose, and undecided by gender and by political party. But my eyes are having trouble comparing. I can feel my eyeballs bouncing up and down as I try to assess if the level of support among independents is higher or lower than the level of support from all Floridians. These items need to be brought closer together to enable viewers to plausibly make these judgments.

I also find it challenging to compare the percentage of opposers in each subgroup. Comparing the percentage of supporters is much easier, since all those bars begin at the same point, at 0%. Since the bars for the oppose category all begin in slightly different spots, comparing their lengths is more difficult. The fact that support data is easier to compare than oppose data hints that somehow the support data might be more important to understand than the oppose data, which I think is an unfair assumption.

I see two possible options for making the comparison between oppose groups more digestible. Option 1: switch the order of the oppose group and the undecided group for each bar. This flip-flop would enable the viewer to more quickly compare the lengths of the oppose bars since they would all be right-aligned. The swap further improves the graph by putting the groups on a scale from positive to negative, with undecided between support and oppose, as it naturally falls.

Option 2: construct a grouped bar chart instead of a stacked bar chart. This type of graph might ease the visual comparisons among opposers since all bars would start at 0%. In this option, the importance of understanding the oppose data is put on equal footing with the importance of understanding the support data.

Same data, different visual

The next step was to take the bad and make it better (well, at least make it less bad). I tried to improve the colors and make things easier to compare. Here’s my visual: