Introduction

In the late eighteenth century, the Scottish engineer William Playfair invented the pie chart, bar chart, line graph, and other graphics to display economic facts. Until then, pictures and graphics were somewhat exclusive to cartography (i.e., map making). Over a century later, Willard Cope Brinton wrote Graphic Presentation and dedicated it to Playfair. The entire book is no longer under copyright and available via this link. In the introduction, Brinton asserts that graphic methods developed so slowly for three reasons:

  1. There wasn’t accurate data readily available.
  2. There weren’t enough competent people available to draw charts on a standardized basis.
  3. The cost of producing graphics was too high in comparison to the written word.

The insinuation was that we were now entering a time period (i.e., 1914) where the impediments to visualizing data were disappearing. Brinton was a little off on his timing in that the field of information visualization didn’t start picking up steam for almost another seventy years (1982) when Edward Tufte wrote his seminal work “The Visual Display of Quantitative Information.” Indeed, most of the field of information visualization has developed over the past three decades when computers allowed us to create graphics without having to learn to draw. In other words, visualization became scalable.

The downside of the increased ease in creating graphs is that there are a lot of bad graphics out there. There is an entire blog dedicated to examining bad visualizations - junkcharts. Often, people don’t know how to create graphs and use the defaults provided by an application like Excel (which may or may not be good). Sometimes, there creativity gets the better of them like in the exploded pie chart below presented in a wired.com article about the anatomy of a winning TED talk.

Perception

Colin Ware, a professor at UNH, covers perception in great detail – in both of his books. Another great resource on visual perception is the free web book by Peter K. Kaiser – The Joy of Visual Perception It is fairly easy to follow visual design heuristics like “use high contrast,” and learning some rules and guidelines for constructing visualizations will go a long way to improve your skills at creating good visualizations. Understanding human visual perception takes a great deal more work but will also improve your ability to ascertain a certain level of mastery in creating visualizations. With regards to high contrast, if we see the image below, the lion’s sand color is not in high contrast to the greenish hues of the tall grasses yet we can spot the lion quite easily. We are genetically hardwired to see the lion as our genetic ancestry largely doesn’t include people that could not see the lion - they were eaten.


Creative Commons licensed, Flickr user Heather Bradley

Before we get too far into why we so readily see the lion and how that relates to creating good visualizations, it is important to understand that some graphics are well understood because they are part of our visual language and are more similar to words on a page. A graphic like the one shown below would be a good example of this. I’ve removed the legend. Take a second and see if you can guess what this graphic is showing?

Weather Map NOAA Weather Map

If you guessed that this is a temperature map for the United States, you would be correct. The reason you were able to guess what the map was is that you have seen it before. It is part of your learned language. If graphical perception was purely based on learned graphical conventions, understanding human visual perception would not be important in creating visualizations. One would merely spend time learning the conventions. Conventions are important, however observing the lion in the tall grass isn’t part of a learned language - it is sensory.

Visual perception is somewhat complex. If you want a fairly in-depth explanation, watch this video from Scott Murray. A simplified description of the steps he explains is:

  1. Light enters our eyes.
  2. Gets transduced (i.e., converted from light signals to neural signals) by our retina into visual information.
  3. Visual information travels to the cortex.
  4. Stops in the lateral geniculate nucleus in the thalamus.
  5. Projects directly to the cortex in an area called V1 or primary visual cortex.
  6. V1 to other cortical areas (e.g., V2, V3, parietal cortex, temporal lobe, etc.).
  7. There are upwards of 30 different visual areas in the brain.
  8. Perception is a complex interaction that isn’t fully understood. It also depends on what we are processing. For example, motion is processed differently than color.

Sounds simple, right? Visual perception is an attempt by our brains to figure out what caused a pattern on our retina. In that process, the brain tries to prioritize what it thinks is important (e.g., the lion in the grass). This importance filtering is referred to as pre-attention. Can you count how many times the number 5 appears in the list?

13029302938203928302938203858293
10293820938205929382092305029309
39283029209502930293920359203920

You had to attentively process the entire list to count the number of 5’s. This probably took quite a bit of time. Try counting again using the list below.

13029302938203928302938203858293
10293820938205929382092305029309
39283029209502930293920359203920

That was quite a bit easier and illustrative of preattentive processing. We told your brain what was important by using shading or color intensity. Many visual features have been identified as preattentive. Christopher G. Healy summarizes them very well in the table below copied from his site on perception in visualization. On Healy’s table, he also lists the citations for the psychology studies that examined each visual feature.

line (blob) orientation
length, width
closure
size
curvature
density, contrast
number, estimation
colour (hue)
intensity, binocular lustre
intersection
terminators
3D depth cues, stereoscopic depth
flicker
direction of motion
velocity of motion

lighting direction

3D orientation

artistic properties

Table 1: A partial list of preattentive visual features.

So how does this explain our rapid identification of the lion in the tall grass? The explanation is probably quite a bit more complex than the observable pattern shifts between the lion and her surroundings. As humans, we probably tend to first look where things might be hiding. Nonetheless, the volumes of human visual perception research help us provide some guidelines and considerations when preparing graphics.

Color

Your retina contains photoreceptors - namely rods and cones. The cones are responsible for your ability to see colors. People with faulty cones may exhibit some form of color blindness. In the text, Few states that roughly ten percent of males and one percent of females suffer from color blindness. True monochromacy (i.e., where people see only black, white, and shades of gray) is exceptionally rare. In visualization, when we talk about color we are talking about the visible spectrum shown below. You’ll notice the color changes across the horizontal axis by wavelength. Although wavelength is continuous (quantitative), it is usually horrible at representing quantitative values (as noted in the visual properties table discussed earlier).

The most common forms of color blindness are the subtypes of red-green color blindness. If you want to learn about color blindness in more detail, consult this free ebook. Duetan color vision deficiencies are the most common. Protan is less common, you can see the effects of both subtypes in the two sets of color spectra below (taken from the ebook referenced above).

If you find that you need to make accommodations for color blindness, a rough rule of thumb is to not use a red-green diverging palette. Brian Connelly has an excellent blog post about [creating colorblind-friendly] figures in ggplot2 and there is also the dichromat package that has color schemes for the red-green color blind subtypes. Since Connelly also talks about the more rare tritanopia, I’ve included an example below.

X and Y - your two best friends

Throughout this course, we will be using guidelines or heuristics that are never set in stone. Think of them as suggestions, rather than laws. The first one is that the x and y axes should represent the two most important or critical variables you are attempting to visualize. To illustrate why this is a suggestion, think about the weather map we saw earlier. In that, there are only two variables represented – location and temperature. The “best friends” heuristic might suggest that you put the location on one axis and temperature on the other, but we don’t do that. Because we chose a map, we are allocating both axes to location (x = longitude, y = latitude). When you only have two variables to represent, x and y are easy choices. When you have a third, fourth, or even fifth variable added to the mix, you need to be more mindful about choosing how to encode the variables visually.

Types of data

In statistics, there are four measurement scales commonly used to classify data: nominal, ordinal, interval, and ratio. It is helpful to understand these categories when planning out a visualization.

Nominal data is categorical with no implicit ordering or magnitude. Bear and dog are two types of animals. The animal type would be considered a nominal variable. Eye color would be another example – notice, there is no potential order in that we can’t say brown > blue > green. A special type of variable that has only two categories is considered a binary variable – we tend to store these variables as either a 1, implying yes (true), or 0 – no (false). Examples would include whether or not a person is an existing customer and, the biological sex of an animal (male, female).

Ordinal data is similar to nominal data but it has an implicit order but we don’t know the exact distance between values. The type of Olympic medal has an implicit order (gold > silver > bronze). Likewise, most customer survey data using a Likert scale is ordered. For example, customer satisfaction survey items often follow the order very satisfied > satisfied > neutral > dissatisfied > very dissatisfied.

Interval data is numeric data that is ordered and has an exact difference between values but no true zero value. For example, FICO credit score, the temperature in Farenheight, and SAT scores are all numeric but have no true zero values. SAT scores and FICO scores have a minimum value of 200 and 300 while Farenheight temperature can have a negative value.

Ratio data is interval data with a true zero value. The temperature in Kelvin, weight, and height would all be considered ratio variables. Because ratio data has a “true zero” we can calculate a ratio. For example, we can’t say that 88 degrees Farenheight is 10% hotter than 80 degrees and it isn’t twice as hot as 44 degrees. If we convert the numbers to Kelvin, we can say that 304.261 degrees Kelvin (88F) is about 8.7% hotter than 279.817 Kelvin (44F). Likewise, we can say that an income of $100,000 per year is twice as large as an income of $50,000 per year.

Sometimes these categorizations can be a little messy. February (2) is one month away from January (1). March (3) is one month away from February (2). If we look at the distance between months using days as a measure it becomes variable – February is a particularly complex example in that it depends on what year it is. We won’t get too hung up on these nuances when planning visualizations. A general understanding of these data types is very helpful in planning visualizations. For interval and ratio data, for visualization purposes, we often just collapse these two categories into “numeric” or “continuous” data types.