9: Perception & Design

Content for Monday, April 27, 2026

Before class

📖 Reading:

ImportantAssignment 3 is due today

Assignment 3: Tidying, Import & Quarto — due Sunday, April 26 at 11:59 PM.

During class

We’ll cover:

  • Why perception matters — how the brain processes visual information
  • Preattentive attributes: color, size, position, shape
  • Gestalt principles and how they shape layout
  • Color theory: sequential, diverging, and qualitative palettes
  • Colorblind-friendly design (and why it matters)
  • Decluttering: removing the visual noise
  • Psychology-specific figures: error bars, interaction plots, raincloud plots
  • Putting it all together with theme() customization
TipAssignment 4 is assigned today

Assignment 4: Visualization Deep Dive — due Sunday, May 3 at 11:59 PM.

Slides

View slides in new tab Download PDF

Embedded slides

After class

Practice:

  1. Take a plot you made earlier in the course. Identify 3 things that could be decluttered.
  2. Recreate it using only theme_minimal() — what disappears? What stays?
  3. Try switching your color palette to scale_fill_viridis_d(). Does it change the story?
  4. Create a raincloud plot (violin + boxplot + jitter) for any grouped data you have
  5. Make a “bad” version of a figure on purpose — violate as many design principles as you can. Then fix it.
NoteThe decluttering checklist

Before you call a figure “done,” ask:

  • Is the background gray? → Switch to theme_minimal() or theme_classic()
  • Are there gridlines? → Remove them
  • Is there a legend when there’s only one group? → Remove it
  • Do the axis labels say something meaningful? → If not, rename them
  • Can someone understand the point without reading the caption? → If not, the title needs work

Colorblind-friendly palettes

# Viridis — works for continuous and discrete
scale_fill_viridis_d()   # discrete categories
scale_fill_viridis_c()   # continuous values

# ColorBrewer — curated palettes
scale_fill_brewer(palette = "Set2")      # qualitative
scale_fill_brewer(palette = "RdBu")      # diverging
scale_fill_brewer(palette = "Blues")     # sequential

These are all built into ggplot2 — no extra packages needed.