Don't bar barplots, but use them cautiously

Should we outlaw the the commonest visualization in psychology? The hashtag #barbarplots has been introduced as part of a systematic campaign to promote a ban on bar graphs. The argument is simple: barplots mask the distributional form of the data, and all sorts of other visualization forms exist that are more flexible and precise, including boxplots, violin plots, and scatter plots. All of these show the distributional characteristics of a dataset more effectively than a bar plot.

Every time the issue gets discussed on twitter, I get a little bit rant-y; this post is my attempt to explain why. It's not because I fundamentally disagree with the argument. Barplots do mask important distributional facts about datasets. But there's more we have to take into account.



Here's my basic argument:

 




When I originally posted that rant, I was in transit and didn't get a chance to illustrate my point, so there was a lot of back-and-forth about what good use cases for bars would be.* The basic one that comes to mind for me is in analyzing datasets where there are many discrete independent variables (e.g., conditions, experiments) and not many observations per participant. This structure describes many experiments I've worked on.

I put together an example visualization, based on Experiment 4 of this paper. All code and data here, in the experiment 4 analysis script. Here's the plot we put in the paper:


I chose a barplot because there were a lot of planned age groups and conditions and it seemed like an easy way to represent that discrete structure in the data, along with summary means and 95% CIs. I like to visualize by-subject distributions (I was actually a bit fetishistic about it in my early papers), but the data I was plotting here had only four observations per child. As a result, simple jitter plots look crazy:


And box plots are useless. 


Violin plots are useless too. 

The best alternative I saw was this one, but it still looks too sparse to me:


Having posted these to twitter along with the data, TJ Mahr rose to the challenge to do better:
I like this representation, and with some tweaking it might be a nice alternative to put in a paper like the one I wrote.

But here's my point: these visualizations are good for different things. The barplot is simple and easy to read � and it compresses well. (This point is made by Heer & Bostock, 2010, as well). Consider what happens when we shrink the plotting space for these (using my version of TJ's so I can hold image size constant):


Or even tinier:



My sense is that the barplot holds up to compression much better, at least modulo the font size. In addition, I would never show the jitterdodge masterwork to a popular audience (or even really to a class). It's just got too much going on. 

My broader point: banning particular data analyses or visualizations just doesn't seem like the right answer. Particular visualizations can be right for certain contexts, for certain audiences, and for certain data types. The world of data is broad. We can change the defaults, but we shouldn't ban something that has important uses. 

---
* Everyone in the discussion agrees that bars are fine for visualizing single discrete values, e.g. as in the counts in a histogram.

Comments

Popular posts from this blog

Should we always bring out our nulls?

Minimal nativism

Town hall on methodological issues