Ebenen hinzufügen

Interaktive Datenvisualisierung mit plotly in R – Fortgeschrittene Themen

Adam Loy

Statistician, Carleton College

Erhöhe den Schieberegler-Text auf 40 und ändere die Farbe auf Schwarz.

Interaktive Datenvisualisierung mit plotly in R – Fortgeschrittene Themen

Textebene

world_indicators %>%
  plot_ly(x = ~income, y = ~co2) %>%
  add_text(
    x = 6500, y = 1, text = ~year, frame = ~year,
    textfont = list(size = 150, color = toRGB("gray80"))
  )

23-text-only-animation.gif

Interaktive Datenvisualisierung mit plotly in R – Fortgeschrittene Themen

Punkt-Ebene

world_indicators %>%
  plot_ly(x = ~income, y = ~co2) %>%
  add_text(
    x = 6500, y = 1, text = ~year, frame = ~year,
    textfont = list(size = 150, color = toRGB("gray80"))
  ) %>%
  add_markers(frame = ~year, ids = ~country) %>%
  layout(
    xaxis = list(type = "log"), yaxis = list(type = "log")
  )
Interaktive Datenvisualisierung mit plotly in R – Fortgeschrittene Themen

Feinschliff

world_indicators %>%
  plot_ly(x = ~income, y = ~co2) %>%
  add_text(
    x = 6500, y = 1, text = ~year, frame = ~year,
    textfont = list(size = 150, color = toRGB("gray80"))
  ) %>%
  add_markers(frame = ~year, ids = ~country) %>%
  layout(
    xaxis = list(type = "log"), yaxis = list(type = "log"),
    showlegend = FALSE
  ) %>%
  animation_slider(hide = TRUE)

23-polished.gif

Interaktive Datenvisualisierung mit plotly in R – Fortgeschrittene Themen

23-polished.gif

Interaktive Datenvisualisierung mit plotly in R – Fortgeschrittene Themen

Lass uns üben!

Interaktive Datenvisualisierung mit plotly in R – Fortgeschrittene Themen

Preparing Video For Download...