Histogram + facet_wrap with plotly in R

Viewed 25

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,

0 Answers
Related