Thoughtful use of color

Interactive Data Visualization with plotly in R

Adam Loy

Statistician, Carleton College

Interactive Data Visualization with plotly in R

Adding a third variable

wine %>%
  plot_ly(x = ~Flavanoids, y = ~Alcohol, color = ~Type) %>%
  add_markers()
Interactive Data Visualization with plotly in R

Adding a quantitative variable

wine %>%
  plot_ly(x = ~Flavanoids, y = ~Alcohol, color = ~Color) %>%
  add_markers()
Interactive Data Visualization with plotly in R

RColorBrewer palettes

wine %>%
  plot_ly(x = ~Flavanoids, y = ~Alcohol, color = ~Type) %>%
  add_markers(colors = "Dark2")
Interactive Data Visualization with plotly in R

Manual palettes

wine %>%
  plot_ly(x = ~Flavanoids, y = ~Alcohol, color = ~Type) %>%
  add_markers(colors = c("orange", "black", "skyblue"))
Interactive Data Visualization with plotly in R

Let's practice!

Interactive Data Visualization with plotly in R

Preparing Video For Download...