dexplo / bar_chart_race

Create animated bar chart races in Python with matplotlib
MIT License
1.35k stars 351 forks source link

Race in Plotly #50

Open jafr1985 opened 3 years ago

jafr1985 commented 3 years ago

Hello all, can anyone tell me how to save the race in plotly, like the second graph on https://www.dexplo.org/bar_chart_race/ with title "COVID-19 Bar Chart Race with Plotly" and Play and Pause buttons. For me already works the bar chart race but exporting to mp4, gif or html.

Best regards.

Package Version


bar-chart-race 0.2.0

huangxin168 commented 2 years ago

In order to save the animation to disk, use a string of the file name of where you'd like to save as the second argument. You'll need to install ffmpeg first in order to save the animation. Once installed, you'll be able to save the animation as a wide variety of formats (mp4, m4v, mov, etc...). To save the animation as a gif, install ImageMagick.

bcr.bar_chart_race(df, 'docs/videos/covid19.mp4', figsize=(5, 3))