Chapter 7 Scatterplot

You should use this method if the data is:

  • Numerical

7.1 Two numeric variables

wage_df %>% 
  ggplot(aes(x = age, y = wage)) +
  geom_point()

Use jitter

wage_df %>% 
  ggplot(aes(x = age, y = wage)) +
  geom_jitter()

7.2 Two numeric, one categorical

wage_df %>% 
  ggplot(aes(x = age, y = wage, color = jobclass)) +
  geom_jitter()