1

I created a gganimate of a histogram + facet_wrap, animated by year, but now I want to have it in plotly so the user can have more control.

Based on the documentation I've found, I have tried to add frame = year and aes(frame = year) in many places but I couldn't make it work. I have managed to make it work without facet_wrap.

The gganimate code that works is this:

ggplot(data = peak_season, aes(x = overall)) +
      geom_histogram(binwidth = 1) + facet_wrap(~league) +
      transition_states(year, transition_length = 1, state_length = 50) +
      view_follow(fixed_y = TRUE)

The regular ggplot code looks like this.

ggplot(data = peak_season, aes(x = overall)) +
       geom_histogram(binwidth = 1) + facet_wrap(~league)

ggplot

Thank you,

Xavier
  • 129
  • 7
  • 2
    Does this answer your question? [How to facet a plot\_ly() chart?](https://stackoverflow.com/questions/58103196/how-to-facet-a-plot-ly-chart) – mhovd Dec 09 '21 at 11:00

0 Answers0