Intermediate Interactive Data Visualization with plotly in R
Adam Loy
Statistician, Carleton College
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"))
)
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")
)
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)
Intermediate Interactive Data Visualization with plotly in R