Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
B

bar_chart_race

> 编程语言
Open source

Create animated bar chart races in Python with matplotlib

1.5K stars0 likes1 views
WebsiteGitHub

About

Create animated bar chart races in Python with matplotlib

Bar Chart Race

Make animated bar and line chart races in Python with matplotlib or plotly.

Official Documentation

Visit the bar_chart_race official documentation for detailed usage instructions.

Installation

Install with either:

  • pip install bar_chart_race
  • conda install -c conda-forge bar_chart_race

Quickstart

Must begin with a pandas DataFrame containing 'wide' data where:

  • Every row represents a single period of time
  • Each column holds the value for a particular category
  • The index contains the time component (optional)

The data below is an example of properly formatted data. It shows total deaths from COVID-19 for several countries by date.

Create bar and line chart races

There are three core functions available to construct the animations.

  • bar_chart_race
  • bar_chart_race_plotly
  • line_chart_race

The above animation was created with the help of matplotlib using the following call to bar_chart_race.

…

Save animation to disk or embed into a Jupyter Notebook

If you are working within a Jupyter Notebook, leave the filename as None and it will be automatically embedded into a Jupyter Notebook.

python
bcr.bar_chart_race(df=df, filename=None)

Customization

There are many options to customize the bar chart race to get the animation you desire. Below, we have an animation where the maximum x-value and order of the bars are set for the entire duration. A custom summary label and perpendicular bar of the median is also added.

…

Issues· 52 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Python

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言