M.A.A.U
8/14/2020
library(plotly)
library(gapminder)
set.seed(100)
d <- gapminder[sample(nrow(gapminder), 1000), ]
fig <- plot_ly(d,
x = ~gdpPercap,
y = ~lifeExp,
size = ~pop,
color = ~continent,
frame = ~year,
#text = ~country,
text = ~paste("country: ", country),
hoverinfo = "text",
type = 'scatter',
mode = 'markers'
)
fig <- fig %>% layout(xaxis = list(type = "log"))
htmlwidgets::saveWidget(as.widget(fig), file = "demo.html")