Genomtänkt färganvändning

Interaktiv datavisualisering med plotly i R

Adam Loy

Statistician, Carleton College

Interaktiv datavisualisering med plotly i R

Lägga till en tredje variabel

wine %>%
  plot_ly(x = ~Flavanoids, y = ~Alcohol, color = ~Type) %>%
  add_markers()
Interaktiv datavisualisering med plotly i R

Lägga till en kvantitativ variabel

wine %>%
  plot_ly(x = ~Flavanoids, y = ~Alcohol, color = ~Color) %>%
  add_markers()
Interaktiv datavisualisering med plotly i R

RColorBrewer-paletter

wine %>%
  plot_ly(x = ~Flavanoids, y = ~Alcohol, color = ~Type) %>%
  add_markers(colors = "Dark2")
Interaktiv datavisualisering med plotly i R

Manuella paletter

wine %>%
  plot_ly(x = ~Flavanoids, y = ~Alcohol, color = ~Type) %>%
  add_markers(colors = c("orange", "black", "skyblue"))
Interaktiv datavisualisering med plotly i R

Nu kör vi en övning!

Interaktiv datavisualisering med plotly i R

Preparing Video For Download...