19
$\begingroup$

Background:

Previously on Cross Validated, we have had questions on:

It was suggested by @david in the comments to this question that we should have a community wiki question with one visualization rule per answer that the community could vote on.

Question

What are the essential rules on designing and producing graphical representations of data?

Rules

  • One rule per answer
  • Ideally, include a brief explanation of why you think it is a good idea
  • Answers with examples (code and image) of good and bad practice preferred.
$\endgroup$

8 Answers 8

14
$\begingroup$

Substance over Form: Choose the appropriate plot, style, coloring or other graphical parameters to show what you want the plot to show, rather than what your graphing package necessarily allows.

$\endgroup$
1
  • 9
    $\begingroup$ (+1) I often prefer to sketch out a graph on paper first to reduce the chance that my design decisions will be guided by the path of least resistance created by the graphing software. $\endgroup$ Oct 7, 2011 at 2:25
13
$\begingroup$

Being familiar with the three dimensions of colour can be helpful. If you use several colours, they should ideally differ on several of those dimensions, not just one.

Value. The graph should remain readable even in black and white. This simple rule should account for colour blindness, low-quality printers and bad lighting conditions. Even if you use different hues, make sure that the values are sufficiently different. In particular, the plots should be dark on a light background (or the opposite), but not grey on a grey value. The worst example would be a blue plot of a red background -- both are middle values, i.e., would give very similar greys after conversion in black and white.

Saturation. Saturation should be used with moderation: a pure red line may be fine, but a thicker, less saturated red line will be more readable (the increased thickness helps distinguish colours and allows you to reduce saturation). On the other hand, a pure red area is painful to look at: do not use saturated colours to fill areas. The Brewer colour palettes (designed for maps, not line plots) give examples of low-saturation colour choices. The worst example would be, again, a saturated background (blue on red or red on blue).

Hue. As mentioned by @gung, avoid the red/green (traffic lights) combination: there are much more colour-blind people than you think. Especially with hue, less is more. For instance, to plot "diverging" values (i.e., quantities that can be positive or negative), only use two hues (for positive and negative values), so that the reader can immediately distinguish what is high and what is low. Using a discrete gradient can result in a much more readable plot: the boundaries between the colours become visible and form a contour plot.

You may want to read S. Few's Practical Rules for Using Color in Charts or refer to any material about "Colour Theory" for art or design students.

$\endgroup$
1
  • $\begingroup$ +1, nice information here. Your point about value and how the colors will render after conversion to black and white is particularly good. The link to the Few paper is helpful as well. One note: it's best not to refer to other answers as "above", use @so-and-so instead; the answers move around based on how many votes they get. $\endgroup$ Jan 31, 2012 at 16:54
11
$\begingroup$

Place as much of the required information within the figure itself. Do not require the reader to reference the caption, e.g. to identify the meaning of various symbols or colors. Place whatever information (or supplementary information) that cannot go into the figure itself in the caption. The idea is to minimize the effort required by a graph viewer to extract the relevant information--best: graph is self-explanatory, next best: supplementary information required can quickly be gleaned from the caption, worst: the viewer must closely read through the whole results section searching for some crucial detail to figure out what is going on.

$\endgroup$
2
  • 1
    $\begingroup$ +1, and we can extend this idea further: We want to make it such that people can see a graph and know (as much as possible) what is going on without having to read the caption, and also when they need additional information to have that available in the caption such that people can read the caption and know what they need without having to read through the paper searching for that one crucial detail. $\endgroup$ Jan 30, 2012 at 18:03
  • 1
    $\begingroup$ @gung as this is CW please feel free to edit the answer to reflect your comments. $\endgroup$ Jan 30, 2012 at 22:16
10
$\begingroup$

Leave time to edit. Making a good graph takes time and it often takes (at least for me) multiple tries.

$\endgroup$
10
$\begingroup$

Make the plot as simple as possible. In Tufte's words, 'minimize the data-ink ratio'.

For example, avoid:

  • more colors or shapes than required
  • more tick marks than necessary
  • 3-D effects on a 2-D plot.
  • using a legend when objects can be labeled directly
$\endgroup$
6
  • $\begingroup$ I disagree with Tufte here. First, a big part of the motivation for this rule in his original book, is how much time you have to spend drawing extra, unnecessary lines; but this is irrelevant today. Second, the real idea is better captured by Cleveland's rule to maximize the informativeness of the graphic, as sometimes the plot can become more informative with more ink, but both rules outlaw the chartjunk that offends Tufte. $\endgroup$ Jan 30, 2012 at 18:07
  • $\begingroup$ @gung where was the effort / time required presented as a motivation by Tufte. I do not recall this part (but I also do not have the text handy). $\endgroup$ Jan 30, 2012 at 22:15
  • 1
    $\begingroup$ I don't have it either, but in his 1st book Visual Display I remember him talking about how many times you had to put down the ruler to draw a graph. Maybe "big" was an overstatement, but I remember reading this and thinking, 'who cares about that now?' In Elements, Cleveland makes a convincing argument that Tufte's rule is mistaken. He argues that the point is to maximize information transfer and shows that this principle also eliminates what Tufte doesn't like, but allows for cases (which he shows) where extra non-data ink helps make the graph more informative. $\endgroup$ Jan 30, 2012 at 23:04
  • $\begingroup$ I should make clear, I don't disagree with some of the specific suggestions (e.g., no 3D, no chartjunk); I'm quibbling with Tufte's rule as the guideline for graphics. $\endgroup$ Jan 31, 2012 at 2:58
  • $\begingroup$ @gung I interpreted the same discussion as a heuristic tool - an easy way for the reader to understand the approach, rather than a way to reduce the work of the designer. $\endgroup$ Jan 31, 2012 at 16:12
6
$\begingroup$

Don't oppose red and green. Color can be helpful, but when using color always bear in mind that a substantial minority of people are red-green colorblind. I once was showing some data to someone, and he couldn't make out what was going on in my graphs--it was a waste and I felt pretty stupid. Other forms of colorblindness are very rare, but red-green is fairly common. This page has a lot of good information. Here are some tips:

  • If you only need two colors, use blue and yellow--don't use red and green.
  • If you need a gradient, go from blue to yellow while changing saturation and lightness simultaneously--don't use the rainbow.
  • If you need to encode more than two elements (e.g., points on a scatterplot from more than two groups, or several lines) back your colors up with different plotting symbols / line styles as well. For example, distinct plotting symbols: o + < s w, or lines: solid, dotted, dashed, dot-dashed, etc (you can also add plotting symbols to your lines or change line weights).
$\endgroup$
1
  • $\begingroup$ This is indeed something I wondered rather often: What is the best color gradient to use ? $\endgroup$
    – steffen
    Jan 31, 2012 at 9:06
4
$\begingroup$

Don't use stacked bar graphs. And on a related note, if you have a Likert scale item, don't feel the need to show the proportion for every response to each item. Those graphs make my eyes bleed.

Don't use pie-charts.

Don't duplicate data that is contained in a graph by throwing in a table.

Use a sans serif font like Arial for graph titles, etc, because those types of fonts are designed to be used that way.

No post on design is complete without a book reference, I really like Statistical Rules of Thumb. Chapter 9 is the bit relevant to the discussion here, and the bits I point to when asked why I hate stacked bar graphs and pie charts. :)

Confession: in one of my first student consulting roles for a small NGO client I gave them a report that had lots of stacked bar graphs, printed in colour (this was the mid 1990s). I think I managed to get yellow, purple, and red into those puppies.

$\endgroup$
3
$\begingroup$

Don't mess with the axes. Don't cut off the first hundred units just because then the slope of the graph looks more impressive. The image will stick and people will remember a much larger effect than was actually measured.

$\endgroup$
5
  • 3
    $\begingroup$ Cutting off data to change the apparent slope is fraudulent. OTOH, there is a real question about whether axes should always include 0, and (somewhat less related) the aspect ratio used. Cleveland makes a strong case that graphs are more informative if you maximize the data within the data window, and 'bank' slopes to 45 degrees. Know your audience, here: Cleveland argues that professional audiences should be taken as competent and literate, but with naive audiences, either explicitly point these features out and explain them, or (possibly) don't use them. $\endgroup$ Jan 30, 2012 at 18:26
  • $\begingroup$ Even professional audiences will (I assume) months later only remember the steep line in the graph and will have forgotten the intercept and everything else. You can have all that data in the (flat) graph by labeling the extreme values correctly and still have the information in it that nothing actually changed oder time. $\endgroup$
    – xmjx
    Jan 31, 2012 at 7:31
  • 2
    $\begingroup$ I disagree. I don't think it is a sensible rule to insist all axes start at zero, if that is what is being suggested. Graphics should show variation and structure in data - if what is important is fluctuation of 100,000 around the value of two million (and maybe how it is different between two groups), the graphic should show that, not that "two million is a large number". $\endgroup$ Jan 31, 2012 at 10:25
  • $\begingroup$ As with basically any design rule, I think that this is one that you can break if you really understand the practical significance of the plotted variation and how your audience will interpret it. But this rule is violated so often and so egregiously that I think it's relatively safe to loudly proclaim "All plots must include zero!*" A Google search of American homeownership plots illustrates this point nicely - in almost every plot, it looks like homeownership fluctuated wildly over the past two decades, when in fact the maximum spread is about 5%. $\endgroup$ Jan 31, 2012 at 19:27
  • $\begingroup$ Not that 5% is irrelevant - and most of those plots are associated with arguments about the consequences of the policies that generated that fluctuation. But I think that those arguments would be even stronger if they emphasized how massive policies with huge economic consequences actually had relatively small effects on homeownership. $\endgroup$ Jan 31, 2012 at 19:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.