Data visualization

SDS 236

Ben Baumer

2025-03-11

Data visualization

How Working-Class Life Is Killing Americans, in Charts

https://www.nytimes.com/interactive/2020/03/06/opinion/working-class-death-rate.html

  • What do you notice?
  • What do you wonder?

How Does Your State Make Electricity?

https://www.nytimes.com/interactive/2018/12/24/climate/how-electricity-generation-changed-in-your-state.html

  • What do you notice?
  • What do you wonder?

What makes a good graph?

Some answers:

  • Tells your story
  • Reveals the data
  • Illuminates, not confuses
  • Grabs interest
  • LOW ink density (ie “not real complicated”) …
    • … for HIGH data density

What makes a great graph?

Sorry, no rainbows

Good viz

Elements of data graphics

Elements of data graphics

  • Visual cues
    • position, length, area, etc.
  • Coordinate system
    • how are the data points organized?
  • Scale
    • how does distance translate into meaning?
  • Context
    • in relation to what?
  • Faceting / small multiples

Perceptual heirarchy

Do’s and don’ts

Do:

  • Mind the perceptual heirarchy
  • Put contextual info on the plot
  • Make an appropriate color choice
  • Match data dimensions to visual dimensions

Don’t:

  • Don’t use color when length will suffice
  • Don’t use pie charts!
  • Don’t use redundant mappings unless you have a reason
  • Don’t map area to a 1D quantity

Read more about this!

Two more books

]

Tufte’s mantra

Color

Three color schemes

  • Sequential

    • Single hue
    • Multi-hue
  • Diverging

  • Categorical

Big Idea: color choices matter and there are better and worse choices

Sequential, single hue

  • Map saturation to numeric variable

  • No more than 5–6 levels

  • People interpret high saturation as more

Sequential, single hue

  • Map saturation to numeric variable

  • No more than 5–6 levels

  • People interpret high saturation as more

Sequential, double hue

  • Map hue to numeric variable

  • Generally, no more than 2 anchor colors

  • People interpret darker hue as more

Diverging

  • Two colors used to indicate extremes of a range

  • Neutral color in the middle

  • distinguish between zero and missing

Categorical

  • Different color = different category

  • choose colors that are

    • perceptually distant
    • roughly the same saturation

Built-in color palettes

  • Cynthia Brewer
  • RColorBrewer package
  • scale_color_brewer() function
  • viridis
  • Comparison

Workshop

bbplot from the BBC

Improving Economist graphics (1)

Improving Economist graphics (2)

Improving Economist graphics (3)

Improving Economist graphics (4)

Improving Economist graphics (5)