Lägga till lager

Interaktiv datavisualisering på mellannivå med plotly i R

Adam Loy

Statistician, Carleton College

Ökar skjutreglagets text till 40 och ändrar färgen till svart.

Interaktiv datavisualisering på mellannivå med plotly i R

Textlager

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

Interaktiv datavisualisering på mellannivå med plotly i R

Punktlager

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")
  )
Interaktiv datavisualisering på mellannivå med plotly i R

Finjustering

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

Interaktiv datavisualisering på mellannivå med plotly i R

23-polished.gif

Interaktiv datavisualisering på mellannivå med plotly i R

Nu kör vi en övning!

Interaktiv datavisualisering på mellannivå med plotly i R

Preparing Video For Download...