New to Plotly?
Plotly's R library is free and open source!
Get started by downloading the client and reading the primer.
You can set up Plotly to work in online or offline mode.
We also have a quick-reference cheatsheet (new!) to help you get started!
##  '4.9.1'
Now, along with
frames is added to the keys that
figure allows. Your
frames key points to a list of figures, each of which will be cycled through upon instantiation of the plot.
library(plotly) df <- data.frame( x = c(1,2,3,4), y = c(1,2,3,4), f = c(1,2,3,4) ) p <- ggplot(df, aes(x, y)) + geom_point(aes(frame = f)) p <- ggplotly(p) p
Mulitple Trace Animations
library(plotly) library(gapminder) p <- ggplot(gapminder, aes(gdpPercap, lifeExp, color = continent)) + geom_point(aes(size = pop, frame = year, ids = country)) + scale_x_log10() p <- ggplotly(p) p
Add Animation Options
library(plotly) p <- p %>% animation_opts( 1000, easing = "elastic", redraw = FALSE ) p
Add Button Options
library(plotly) p <- p %>% animation_button( x = 1, xanchor = "right", y = 0, yanchor = "bottom" ) p