Making effective plots can tell you a LOT about data. Its hard! Its an under-rated but very powerful skill to develop.

- Di Cook

suppressPackageStartupMessages(library(tidyverse))
library(gapminder)
knitr::opts_chunk$set(fig.width=5, fig.height=3)

1 Agenda

Tips for effective graphing

At least two exercises related to content and http://viz.wtf/ (see the worksheet).

2 Resources

These resources are listed on the syllabus in the lecture table. They provide a good overview of tips for effective plotting.

Here are some resources that dive a little deeper:

An entertaining but inspiring resource:

If you want to spend more time on this and/or dig deeper, take a look at the following books:

3 Preface

Disclaimer: The tips you see here and online hold true for most cases. There might be some rare cases where the tips don’t hold – the key is to be intentional about every component of the graph.

“Let’s Practice What We Preach: Turning Tables into Graphs” by Gelman A, Pasarica C, Dodhia R. The American Statistician, Volume 56, Number 2, 1 May 2002 , pp. 121-130(10).

4 Learning Objectives

From today’s lecture, students are expected to:

For the quiz, you aren’t expected to know/memorize all of the tips.

5 Consider Information Density

Sometimes called overplotting.

gapxy <- ggplot(gapminder, aes(lifeExp, gdpPercap)) +
    theme_bw()
gapxy + geom_point()

gapxy <- gapxy + scale_y_log10()
gapxy + geom_point() 

gapxy + geom_point(alpha=0.2)

gapxy + geom_hex() 

gapxy + geom_density2d()

gapxy + facet_wrap(~continent) + geom_point(alpha=0.2)