Bar chart with a log axis, “NEVER”! says the Biz Intel Guru

I’m a big fan of the team at SAS that works on the SG (statistical graph) procedures. Their work enables others to tell richly detailed stories by leveraging SG procedures. The team is led by Sanjay Mantange. Just 3 days ago I attended a session at the SAS Global Forum (SASGF12) where Sanjay spoke about the work he and his team have done for SAS version 9.3. It was obvious from the meeting that Sanjay and his team are incredibly user-focused and are really good at what they do.

So I was surprised today when I read Sanjay’s most recent blog update and saw this chart.

Bar chart with a log axis

There are a handful of ways you can ruin a bar chart. One way is to make them 3D. Why is 3D bad, read this for details. Another way to wreck a bar chart is to start out the numeric axis at a value that isn’t zero. Bar charts are only effective when we can use the length of each bar to make rapid comparisons. If one bar is twice as long as another bar, then we expect the value to be twice as much as the other bar. By starting a bar chart with something other than zero, you are telling a visual lie because we can’t use the length of the bar to compare the magnitude of the differences. When Sanjay created a bar chart with a log axis, he violated the expectation of anyone who reads the chart because we can’t use the length of the bars to directly compare values. A simple table would’ve worked much better. And sorting the table by horsepower would be an even better option, as you can see below.

Table showing horsepower comparison

Horsepower comparision

What Sanjay did came from a good place. He says in his blog post that a few people mentioned to him that they wanted to create a bar chart with a log axis. But just because people want something, doesn’t mean you should give it to them. Sanjay is an expert in his field. Rather than satisfying the customer’s request, he might have offered up a better alternative, like a dot plot.

Dotplot

Better, a dotplot alternative to log scale bar chart

The dot plot doesn’t have the same problem as the bar chart, we’re not comparing lengths of bars, we’re looking at the position of the dot along the X axis. Stephen Few has a great guest post by Info Viz superstar, Dr. Naomi Robbins, about dot plots, and how, in the right circumstances, they can be a great alternative to bar charts. That paper can be found here.

In this instance SAS would’ve better served their customers by offering up the dot plot as an alternative to a log scaled bar chart. As information visualizers, it’s our job to help people see things clearly. It’s not an easy thing to do, but there are consequences when we get it wrong. Those consequences range from wasting people’s time in meetings, to missing important opportunities, to the destruction of the space shuttle challenger and the death of the 7 astronauts aboard (thanks Edward Tufte).

When it comes to creating clear and insightful graphs, the Customer isn’t always right.

So, what do you think? Are there exceptions to the bar chart rules laid out above? Was SAS right in giving the customer what they wanted?

4 thoughts on “Bar chart with a log axis, “NEVER”! says the Biz Intel Guru

  1. I think it is wrong to say ‘never’ here.

    This data set is not appropriate for a log scale, clearly.
    A log scale is designed to compare values that have orders of magnitude of difference. This data does not.

    With the right data, and for the right audience, a bar chart with a log scale can be appropriate.

    In this case, I also wouldn’t bother with going the dot plot route, although I wouldn’t say it is wrong either.
    But this data is perfectly acceptable data for just a simple straightforward bar chart. It would show the differences between the vehicles extremely well, and remain quite simple and clear in a way that any viewer can instantly understand.

    1. Thanks for your thoughtful comment Jamie. You’re right, for this specific set of data, a bar chart (without the log axis) would be appropriate.

      The point I was trying to get across related to Sanjay’s desire to use an appropriate chart for data with large differences in values. For that, a bar chart typically isn’t appropriate, and a dot plot may be a better alternative.

      I’ll stick to my guns on NEVER using a log axis on a bar chart. The reason this should be a hard and fast rule is because, good info visualizers don’t present graphs that break a rule that most of us learned in 2nd grade. The bar chart is so effective because humans are really good at comparing the heights of the bars. As long as the difference in the bar heights is kept absolute (2x height difference is 2x value difference), then no one gets hurt. Once you break that relationship between bar height and bar value, then you really ought to move onto another chart type, or a table. Explaining graphs is kind of like explaining jokes, if you have to do it, it’s probably pretty bad.

      Logging the scale creates the kind of dissonance that those orange freight trucks with the yellow logo create.

      Yellow logo

      While it may be great for “Yellow” to turn our expectations upside down, it’s probably not something you want to do to your audience when they read your chart.

  2. The point of my post was to investigate if it was possible to create a bar chart with log response axis using SG procedures. As mention in my post, one cannot use a log axis with the SGPLOT VBAR statement.

    But I assume the requesting users has a valid reason to do what they want, and I am investigating avenues to acheive such a result.. After all, you can do almost anything with Annotate anyway. Note: We also provide pie charts and dot plots. :-)

    It is good, however, that John has stepped forward with a discussion of not how, but if such a plot should be used.

  3. Hi Sanjay,

    Thanks for making the trip over here to post your comments.

    I think it would be great to know the use case that the requesting user had in mind. I will bet you that there is a better alternative. And if there is a better alternative, then shouldn’t we suggest it to them? Isn’t that “The Power to Know”?

    If there isn’t a better alternative, then I will buy a copy of your upcoming book, “SAS ODS Graphics Designer: An Interactive Graph Builder” and literally eat a page from it. Actually, I’ll probably buy it in any case :>

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>