Baike.dev
All 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 likes0 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.

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.

…

GitHub Issues· 52 open

View all on GitHub
  • #85

    Most Runs In ODI Cricket

    Updated May 2, 2026
  • #83

    How to get rid of whitespace on right in 0.2.0?

    Updated Nov 3, 2025
  • #82

    how to remove grid lines

    Updated Apr 23, 2025
  • #81

    change config in power bi

    Updated Feb 3, 2025
  • #78

    Library for Line Chart Race?

    Updated May 17, 2024
  • #77

    R Environment

    Updated Mar 9, 2024
  • #76

    How to exclude bars with zero values?

    Updated Mar 4, 2024
  • #66

    Error when using figsize: unexpected keyword argument

    Updated Feb 14, 2024
  • #75

    pip install bar_chart_race to install bar_chart_race 0.1.0

    Updated Nov 14, 2023
  • #26

    Change text format on the bars to float

    Updated Sep 27, 2023

Highlights

  • •pip install bar_chart_race
  • •conda install -c conda-forge bar_chart_race
  • •Every row represents a single period of time
  • •Each column holds the value for a particular category
  • •The index contains the time component (optional)
  • •bar_chart_race
  • •bar_chart_race_plotly
  • •line_chart_race

> 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 推出的简洁高效系统语言