Clutter and focus

Materials for class on Monday, November 6, 2017

Contents

Slides

Download the slides from today’s lecture.

First slide

Fonts, colors, and accessibility

See the relevant sections in the Reference page.

Refining and enhancing plots in Illustrator

Data: Nathan’s Famous Hot Dog contest winners Data originally from FlowingData.

Plot with transparent background:

library(tidyverse)
hotdogs <- read_csv("data/hot-dog-contest-winners.csv") %>%
rename(dogs = `Dogs eaten`, record = `New record`) %>%
mutate(record = factor(record))
plot_hotdogs <- ggplot(hotdogs, aes(x = Year, y = dogs, fill = record)) +
geom_col() +
scale_fill_manual(values = c("grey80", "#FC7300")) +
scale_x_continuous(breaks = seq(1980, 2010, 2), expand = c(0, 0)) +
scale_y_continuous(breaks = seq(0, 70, 10), expand = c(0, 0)) +
guides(fill = FALSE) +
labs(y = "Hot dogs and buns", x = NULL) +
theme_minimal() +
theme(panel.background = element_rect(fill = "transparent", colour = NA),
plot.background = element_rect(fill = "transparent", colour = NA),
axis.ticks.x = element_line(size = 0.25),
panel.grid.major.x = element_blank(),
panel.grid.major.y = element_line(size = 0.5, linetype = "dashed"),
panel.grid.minor = element_blank())
plot_hotdogs

ggsave(plot_hotdogs, filename = "output/hotdogs.pdf",
width = 7, height = 4, units = "in", bg = "transparent")

Text for annotations:

Enhanced plot:

Enhanced hot dog eating contest graph
Enhanced hot dog eating contest graph

Feedback for today

Go to this form and answer these three questions (anonymously if you want):

  1. What new thing did you learn today?
  2. What was the most unclear thing about today’s class?
  3. What was the most exciting thing you learned today?