Problem set questions?

Artwork by @allison_horst

Artwork by @allison_horst

Evaluating Visualization

Cairo’s Criteria

Is it Truthful? Does it get the information as right as possible? Are you honest with yourself and your audience?








Is it Functional? does it help your audience interpret the information correctly? Has the purpose in producing the figure shaped the information?

















Is it Beautiful? Does it elixit an emotional experience for the reader – awe, wonder, pleasure, surprise? If appropriate, is it simple and elegant?







Is it Insightful? Does it reveal new knowledge, either spontaneously or gradually? Does it reveal something to the reader, helping them build knowledge?















Is it Englightening? Does it provoke a reader to change their mind? Does it contribute to improving well being?

















Healey and a little bit of visual perception

  • Aesthetic issues (bad taste)
  • Substantive issues (bad data)
  • Perceptual issues (bad perception)
  • “At the intersection of perception and interpretation there are specific visual tasks that people need to perform in order to properly see the graph in front of them.”

Next week: your examples of bad data viz!

Viz in R: ggplot

From Week 1

forcats and Factors

Factors are variables which take on a limited number of values, aka categorical variables. In R, factors are stored as a vector of integer values with the corresponding set of character values you’ll see when displayed (colloquially, labels; in R, levels).

property %>% count(condition) # currently a character

property %>% 
  mutate(condition = factor(condition)) %>% # make a factor
  count(condition)

# assert the ordering of the factor levels
cond_levels <- c("Excellent", "Good", "Average", "Fair", "Poor", "Very Poor", "Unknown")
property %>% 
  mutate(condition = factor(condition, levels = cond_levels)) %>% 
  count(condition)

The forcats package, part of the tidyverse, provides helper functions for working with factors. Including

  • fct_infreq(): reorder factor levels by frequency of levels
  • fct_reorder(): reorder factor levels by another variable
  • fct_relevel(): change order of factor levels by hand
  • fct_recode(): change factor levels by hand
  • fct_collapse(): collapse factor levels into defined groups
  • fct_lump(): collapse least/most frequent levels of factor into “other”

To the practice script

  • Last week’s examples
  • Distributions (fill, color, alpha; axes ranges, legends, and labels)
  • Amounts (fill, position, color; legends and themes)
  • Proportions (polar coordinates, themes)

XKCD Inspiration

XKCD, Randall Munroe, https://xkcd.com/1338/