Sunday, September 30, 2012

your input please: font

We have a small debate underway in my day job regarding font. Specifically, which should be our default or standard font for analyses, presentations, etc. This led me to the question: when it comes to font choices, where do best practices end and personal preferences begin?

I'm aware of some relevant research conducted by psychologists Song and Schwarz in 2008 at the University of MI at Ann Arbor, where they showed college students recipes for sushi and asked them to estimate 1) how long the recipe would take them to make and 2) how inclined they were to do so. The only thing that varied between the recipes was the font in which it was written. What they found in a nutshell was that the fussier the font, the more difficult the students judged the recipe and the less likely they were to want to attempt making it. For me, the translation for data visualization broadly is that the more complicated it looks, the less likely your audience is to take time with it.

But back to my specific question: if both fonts are straightforward to read (no legibility issues), how do you choose?

To try to answer this question, I initially planned on doing some research; I quickly grew impatient with this. My brief attempt in Google searches taught me that there is no shortage of font fodder on the internet. There are conflicting lists of the "best" fonts (example). Others have done much more research in this area than I care to (example). I was struck that there don't even seem to be consistent opinions on questions I thought would be easy (e.g. serif vs. sans serif... sans, obviously, right? not according to Wikipedia).

So rather than continue down this slightly frustrating path, I thought I'd pose the problem to you to see if any consensus in the form of the wisdom of crowds emerges. Here are the fonts we're considering:


The quick brown fox jumps over the lazy dog
1234567890 (Calibri)

The quick brown fox jumps over the lazy dog

1234567890 (Open Sans)

The quick brown fox jumps over the lazy dog
1234567890 (Arial)


Specifically, when it comes to the open debate at work: my colleague and I are in agreement that Calibri should not be our default font. I think our reasoning when you boil it down is probably simply because we don't like it vs. anything scientific. Where we differ is on the question of Open Sans vs. Arial. I won't bias you by revealing which I prefer (though my sans serif comment and the text on this blog serve as a pretty big hint).

My questions to you are: If you were weighing in on this decision, what factors would you consider? Which font do you prefer? Why? Leave a comment with your thoughts!

Thursday, September 27, 2012

quick tip: left uppermost align title text

I've commented in the past about the important role that text plays in data visualization: in short, it helps to make the information you provide more accessible to your audience. But where should you place your text for it to best play its role? When it comes to chart and axis titles and legend, my recommendation is to left uppermost justify.

I frequently see chart and axis titles center-aligned and the legend placed to the right of the data it describes. Many standard tools default to this. I favor left uppermost justifying over center-title-alignment and righthand-legend-placement due to two reasons:
  1. Center alignment looks messy: center alignment doesn't create a clean line on either the left or the right, so text is left visually hanging.
  2. Your eye hits the left uppermost space first: in Western cultures, most people read left to right, top to bottom*. This means if you left uppermost justify your graph title, legend, and axis titles, your audience's eye hits how to interpret what they're looking at before they get to the data. 
*I'm frequently asked the question how this changes in cultures reading in other directions: the small sample I've posed this question to have said that when it comes to business, the Western style prevails since so much international business is conducted in English. Please leave a comment with your thoughts if you have insight on this!

What I mean when I say "left uppermost align" when it comes to graph titles and legend is:
  • Graph title (+subtitle, if applicable) are positioned above graph and left-aligned.
  • Legend is placed above graph (below title/subtitle) and left-aligned.
  • y-axis title is aligned with topmost y-axis label.
  • x-axis title is aligned with leftmost x-axis label.

Here's a quick look at what a typical graph looks like with default text alignment settings compared to when we follow this tip:


Personally, I steer clear of center alignment almost always in favor of left- or right-alignment. Outside of titles and legends, whether to left- or right-align your text comes down to the layout of the visual: sometimes right-alignment makes sense, for example in a horizontal bar chart you should right-align your y-axis labels so that funny spacing isn't created between the labels and the data. When in doubt, try aligning a couple of different ways and see what looks best: trust your eye or solicit input from a colleague.

Note: the Excel template to create the left uppermost chart above can be downloaded here.

Thursday, September 20, 2012

bar charts must have a zero baseline

This is one rule of data visualization that I see broken too often: when it comes to bar charts, the y-axis must begin at zero.

When our eyes interpret bar charts, we are comparing the relative heights of the bars. When we cut the height off at something greater than zero, it skews this visual comparison, over-emphasizing the difference between the bars in a way that simply isn't honest. Most recently, I saw this in a visual that was forwarded by a friend of a colleague. The offender: Fox News.


There are a number of things that bother me about this visual. Beyond the unnecessary visual clutter of tiny gridlines and strange chart borders, the y-axis isn't labeled (I think it's Top Tax Rate, as noted by the subtitle, but this would be a lot clearer if the axis itself were labeled) and it is placed on the right-hand size of the visual, so it's the last thing I see as my eyes scan across from left to right, making it even less likely that I see the biggest issue with the graphic, the fact that the y-axis starts at 34%. This makes the difference between Now (35%) and Jan 1, 2013 (39.6%) appear to be way bigger than it actually is.

How big of an issue is this? Let's do some math to find out. The way it's graphed, the height of the bars are 1 (35-34) and 5.6 (39.6-34). This represents a visual increase of 460% ((5.6-1)/1). If we graph the bars with a zero baseline so that the heights are accurately represented - 35 and 39.6 we get a visual (and actual) increase of 13% ((39.6-35)/35). Perhaps that is still significant and that is the point that Fox News was attempting to make. That's fine, but I wish they would have done it without this visual misrepresentation of the truth.

A couple related things to consider (and I have my own opinion on each of these that I'll of course make clear):
  • I've heard the argument that if you're graphing something that has a sort of "natural" baseline of something greater than zero, then it might be appropriate to start with that. For example, if we consider the baseline unemployment rate to be 5%, then the argument goes that you could use this 5% as the baseline. I don't like it. For me, it isn't a valid visual comparison, so if that were the case, I'd use a different way to show it (perhaps plot the entirety of the bars but then also highlight 5% horizontal line and label it in a way that makes it clear how to use it for comparison).
  • When it comes to line graphs, the zero baseline rule does not hold. In other words, you can get away with a non-zero baseline in a line graph. With line graphs, we compare the lines to each other more than their height from the x-axis. Still, you need to be careful. I would advise to make it clear to your audience that you're using a non-zero baseline so they interpret the information correctly (one approach: label the y-axis and highlight the minimum value in bold so attention is drawn that it's something other than zero). And you need to be careful about zooming in too much and making a change that is minor look big - this gets you back into the visual misrepresentation place that we want to avoid.
My advice to Fox News (and to those communicating with data in general) would be to first determine the story you want to tell. Then determine what data will best support this story. Don't compel your audience with visual misrepresentations; rather, convince them with accurately displayed data that backs up the point you are trying to make.

Related note: there are a number of posts by others on this and related topics. In case you're interested in reading more, here are a few I'm aware of (not an exhaustive list):