Readable Graphs

I don’t know how it is for academic scientists in other fields, but me and my computer science colleagues review tons of papers—in 2010 alone I’ve reviewed more than 40 full papers.  As a reviewer, I appreciate anything authors do to make my job easier.  (And to be perfectly honest, I resent anything they do to make my job harder.  You’re asking me for my time; don’t waste it!)

Thus I’m always looking for ways to make my papers easier and more pleasant to review.  One thing I’ve been thinking about lately is making graphs.  It’s generally easier to make readable graphs in color than in grayscale.  These days we can use color because reviewers will receive an electronic copy of the paper in full color. Most of the papers I’m asked to review have full-color graphs. 

The problem, though, is that I don’t like to read papers on my monitor.  I like to print them out and lie on the couch with a pen and a beer, possibly with the TV on in the background.  To limit my wastefulness, I print them in the lowest quality grayscale.  The result is that many of these color graphs become unreadable—they were not designed to be looked at in black-and-white.

This isn’t just my problem. Some people are colorblind; many graphs use reds and greens that may be hard for a colorblind individual to distinguish. Some printers don’t print colors as they appear on screen; the wrong colors can get lost on paper. The moral is that it’s easier to throw together a decent-looking graph using color, but it takes more effort to be sure that graph is readable to everyone.

I want my graphs to look good in both color and grayscale.  The simplest approach is to use different line types (e.g. solid, dotted, dashed, dash-and-dot) along with different colors.  That way, even if the colors all come out the same shade of gray, the lines are still differentiable by their type.  But this is still asking the grayscale reviewer to do work that the color reviewer doesn’t have to do:  differentiating between line types with no color cues takes more cognitive effort than differentiating between colors.

So I’ve been thinking about how I can use colors that, when printed in grayscale, will come out as clearly different shades of gray.  I found Colorbrewer, a web-based tool that allows you to specify how many different colors you need; whether the data is sequential, diverging, or qualitative; and, best of all, whether you need the colors to be “photocopy-able”, meaning they’ll show up in black-and-white. It can also check whether colors are colorblind-safe and print-friendly. Colorbrewer is designed for coloring maps, and unfortunately some of the colors they suggest are far too light for a line plot with a white background. Nevertheless, I’ve found it very useful for my current crop of papers.

I’ll close this post with a sample of R code for a line plot I’ve been working on. This has four different classes of data; I used the “PuOr” scheme recommended by Colorbrewer.

plot(x, y, type="l", log="xy", xlab="x", ylab="probability")
lines(m1, lty=2, lwd=2, col="#5E3C99")
lines(m2, lty=3, lwd=2, col="#FDB863")
lines(m3, lty=4, lwd=2, col="#E66101")
grid(equilogs=F)
legend(x="topright", c("empirical distribution", "model 1", "model 2", "model 3"), lty=1:4, lwd=c(1,2,2,2), col=c("black", "#5E3C99", "#FDB863", "#E66101"), bg="white")

R produces the color version on the left; the version on the right is how it should look when printed.

It’s not quite there yet—the two darker colors are a bit too close in grayscale—but it’s definitely better than not thinking about the problem at all.

Advertisements
This entry was posted in Presentation and tagged , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s