MakeYourChart

Making a bar chart race in Python (and the no-code shortcut)

Python can make a bar chart race in about ten lines, and it's a great option inside a data pipeline. For a one-off social video, a no-code tool is usually faster. Here's both.

No signup to start · Free 720p export · Pro $11.99/month

The Python route

  1. Install the library and ffmpeg: pip install bar_chart_race, plus ffmpeg on your system for MP4 output.
  2. Load your data with pandas so each row is a date and each column an item: df = pd.read_csv('data.csv', index_col='date', parse_dates=['date']).
  3. Render it: import bar_chart_race as bcr, then bcr.bar_chart_race(df=df, filename='race.mp4', n_bars=10, period_length=500, steps_per_period=20).
  4. Tune the title, colors and figure size with the function's arguments, and re-render.

Things to watch out for

  • The bar_chart_race package's last release was in 2020, so recent pandas or matplotlib versions can need small fixes or a maintained fork.
  • Rendering a long race with many steps per period can take minutes.
  • Vertical 9:16 output, safe zones, fonts and end cards are all up to you.
  • Plotly's animation_frame gives an interactive alternative for notebooks, but exporting it to video takes extra work.

The no-code route

Same data, same chart, with easing, labels, captions and a leaderboard ending built in:

  1. Save the same DataFrame with df.to_csv() or copy it from a notebook.
  2. Paste it into the MakeYourChart editor and choose Bar race.
  3. Pick 9:16 or 16:9, write a hook title, and export the MP4.

Frequently asked questions

Which is better for automation?

Python, if you need to generate many videos from a pipeline on a schedule. For hand-crafted videos you'll post on social, a visual editor is quicker to iterate on.

Can I use data from a Jupyter notebook?

Yes. Export your DataFrame with to_csv() and paste or upload the file.

Is it free?

Yes. You can build, preview and export 720p videos with a small watermark for free, no account needed. Pro is $11.99 a month and swaps our watermark for your logo, adds 1080p and 4K, 60 fps and music. Pro + AI is $19.99 a month and adds AI cleanup for messy data.

Start from a template

All 70 templates

Keep reading

Make your first one in two minutes.

Open the editor