17

I have noticed that many "state of the art" plotting packages and themes and many distinguished data folks use grey background for their plots. Here are several examples:

ggplot2:

enter image description here

Nate Silver's fivethirtyeight.com:

enter image description here

While in the first example above (ggplot2), one may argue that using grey background reduces the ink needed for grid lines, this is certainly not the case with the second case. What are the advantages of using grey background, as opposed for white or transparent one?

kjetil b halvorsen
  • 63,378
  • 26
  • 142
  • 467
David D
  • 717
  • 5
  • 13
  • 2
    A plot is a dish served - grey background is a plate. – ttnphns Jan 06 '15 at 14:18
  • 3
    @ttnphns I like the analogy. Hadley Wickham said of ggplot's background: "The grey background gives the plot a similar colour (in a typographical sense) to the remainder of the text, ensuring that the graphics fit in with the flow of a text without jumping out with a bright white background. Finally, the grey background creates a continuous field of colour which ensures that the plot is perceived as a single visual entity." He also justified gridlines on the basis that they can easily be "tuned out". – Silverfish Jan 06 '15 at 22:03
  • @silverfish If you rewrite your comments as an answer I will happily "accept" them – David D Jan 07 '15 at 09:36
  • It seems from that quote, that the choice for ggplot actually *ignored* invocations of "data-ink", and was justified on quite different criteria. I'm in little doubt that Tufte's concept of "ink" is quite literally, the *physical quantity of ink needed to print the graphic*, a criterion your sample plots would "fail" on. But Xan's answer draws an interesting distinction between "physical" and "logical" ink. The data-vis expert Robert Kosara queries [what ink even means](https://eagereyes.org/blog/2013/definition-chart-junk) when no longer using black ink on white paper (e.g. adding colour). – Silverfish Jan 07 '15 at 12:23
  • 1
    ttnphns I also really like your analogy. @silverfish yes, exactly right, with the grey scale matching a squint your eyes and compare the plot square with the text on the page. Hadley has made the grey background popular. His design with the grey plot background but white support (axes) makes it clear where the data begins and ends. And the data pops out with more visibility than the background grid, which follows good cognitive principles. The grid sits back until you need to use it to look up values. – Dianne Cook Jan 07 '15 at 22:39
  • The grey background annoys some people, as seen in the main thread of the link sent by @whuber. I think primarily because it reduces the black/white contrast of data to background, which is a good reason to switch it. If I have to photocopy pages overriding the grey to make it white usually gives better rendering of the plots. – Dianne Cook Jan 07 '15 at 22:42
  • @Dianne I wonder if you have research support for your suggestion about cognitive principles? I would like to give a fuller proper answer (or for someone else to!) and something citable would be nice. One thing that interested me about Hadley's response is it's clear his implementation was based largely on gut feeling (which many of us find well-judged) rather than because he was following the recommendation in a published paper. Incidentally, one of the highest-viewed StackOverflow ggplot2 Qs is how to change the background colour! Photocopying/printing/editorial requirements I suspect. – Silverfish Jan 07 '15 at 22:47
  • 3
    @Silverfish Look first to Jacques Bertin (*Semiologie Graphique*), Alan MacEachran (*How Maps Work*), and Lee Wilkinson (*The Grammar of Graphics*). MacEachran gives the full physiological, psychological, and cultural details with loads of references. Don't be put off by the reference to "maps": his book is concerned primarily with how people interact with and create meaning out of informational graphics in general, of which maps are just a salient example. – whuber Jan 07 '15 at 22:53
  • @whuber Many thanks. I see we both noticed this thread's link to the related one about gridlines and background colour as chartjunk! I think this question ploughs a similar furrow but takes a slightly different angle of attack; do you think it is likely to be closed as a duplicate or is it sufficiently distinct? (It seems to me that with a little rewording, the crux of the question can remain while rendering it more clearly distinct, if that were desirable.) – Silverfish Jan 07 '15 at 23:01
  • @Silver I think the questions are distinct. I did not even mean to intimate that a solid background is "chartjunk" nor that it affects the data-ink ratio. It is neither of those. Chartjunk is gratuitous, distracting decoration--whereas a solid background serves some integral purpose--and although Tufte used "ink" as a casual metaphor for the complexity of a graphic, it's silly to measure ink solely in terms of physical ink consumed in hardcopy production! – whuber Jan 07 '15 at 23:22
  • 2
    @silverfish It is possible that dan carr's work, who started using the grey background and white grid lines with the tables to plots work in the early 90s http://dev.bowdenweb.com/maps/m/using-gray-in-plots.pdf is the source of the idea. I know Hadley and discussed this. But the analogy to the text squint grey scale is Hadley's explanation. – Dianne Cook Jan 13 '15 at 17:03
  • @DianneCook That link is fascinating, thanks. I will find time to work that into my answer. – Silverfish Jan 13 '15 at 21:46

2 Answers2

19

The data-ink ratio

This concept is due to the very influential Edward Tufte, of Yale University, who described it in The Visual Display of Quantitative Information.

He distinguishes "data ink" (which includes points, bars etc but also textual or grpahical labels) from erasable ink (including gridlines, axes, borders, and also redundant information). The data-ink ratio is simply that proportion of the ink used which can't be erased.

There is a discussion of how these data-ink principles might apply to computer visualisations on the UX stack exchange site.

Why do some experts prefer a grey background?

Hadley Wickham has justified his choice of default background, in his book on ggplot2:

The grey background gives the plot a similar colour (in a typographical sense) to the remainder of the text, ensuring that the graphics fit in with the flow of a text without jumping out with a bright white background. Finally, the grey background creates a continuous field of colour which ensures that the plot is perceived as a single visual entity.

The principle seems to be to stop it "jumping out" at the viewer on a printed page and to provide visual unity. Personally I also like the reduced screen glare.

He also justified the white gridlines on the basis that they can easily be "tuned out". I agree with Dianne Cook in the comments that this lets the data stand out above the gridlines, reducing visual clutter. The white gridlines are one advantage of a slightly darker background — interestingly, Tufte generally avoids gridlines where they are not necessary (they do not count as "data ink") but on some grey bar charts overlays white gridlines. In some ways this is a similar effect to ggplot2, but actually puts the gridlines in the foreground, giving the bars a "striped" appearance. A particular disadvantage of this is that you can't see the next-highest gridline above a bar, making it hard to visually interpolate how high a bar is numerically.

Why do some experts prefer a white background?

One of the most-viewed ggplot2 threads on Stack Overflow is " How do I change the background color?" which suggests the default is not universally popular.

The colour of an element can appear quite different depending on what background colour it is displayed against. Tufte actually discusses this in Chapter 5 "Color and information" in his book Envisioning information but doesn't put this in the context of e.g. a scatter plot. Maureen Stone, a colour expert and adjunct professor at Simon Fraser University, strongly recommends a white background for various reasons, including that most colour palettes (in your examples, used to indicate the species or division) have been designed with a white background (for printing) in mind. Their perceptual properties will differ against a darker background. She suggests that white has a perceptual advantage, because our colour perception is relative to "local" white, so having a white background visually available can stabilise our perception.

She also suggests a more practical reason that I am familiar with: that using a white background allows you to optimise a graph for both electronic display and printing, rather than having to prepare a different printer-friendly version.

Silverfish
  • 20,678
  • 23
  • 92
  • 180
  • 2
    +1 for painting (as it were) both sides of the issue. I'd heard Hadley's reasoning but hadn't heard Stone * Fraser's. Thanks! – Wayne Feb 03 '15 at 15:35
8

As long as the background is light enough to provide good contrast with the data marks, it's mostly a matter of aesthetics whether it's white or light gray. While the background color is "ink" in some sense, I don't think it counts as "ink" logically. There is no proportional distraction from a solid field of light gray.

Conversely, the grid lines count as logical "ink" in both cases. Even though the white grid lines would consume no ink to print, they still break up the background and create extra visual processing work. I'd say the 538 grid lines take less logical ink because they have less contrast.

xan
  • 8,708
  • 26
  • 39
  • "I'd say the 538 grid lines take less logical ink..." -- I agree, I find the default ggplot2 gridlines extremely distracting. In the ggplot2 example at the top of the OP's question, my eyes are drawn to the gridlines rather than the data. – Adrian Mar 09 '16 at 13:23