File Exchange

image thumbnail


version 1.0.0 (46 MB) by michio
This entry provides a function that generates a bar chart race plot.


Updated 23 Apr 2020

From GitHub

View license on GitHub

barChartRace(X) draws the animation of the bar chart for each rows of X. X can be numeric array, table, or timetable.

h1 = barChartRace(X) returns a handle (h1) to the figure with bar chart.
[h1,h2] = barChartRace(X) returns a handle (h2) to the figure with the data description in addition to h1.
[ __ ] = barChartRace(X, Name, Value) to use some Name-Value Pair Arguments.

There are also some sample scripts that will generate a bar chart race plot. These can be a good example to work through the basic ideas behind the bar chart race animation with the graphics object of MATLAB. These scripts can work with the earlier version of MATLAB.

- barChartRace_UniColor.m: Single color version
- barChartRace_multiColor_oneBar.m: Multi-color version with one bar object.
- barChartRace_multiColor_multiBar.m: Multi0color version with multi-bar objects (for users with R2017a or earlier.)

Note: The implementation of a function barChartRace is similar to that of barChartRace_multiColor_oneBar.m but many additional options.

Cite As

michio (2021). BarChartRaceAnimation (, GitHub. Retrieved .

Comments and Ratings (1)

Hossam Hassan

MATLAB Release Compatibility
Created with R2019b
Compatible with R2019b and later releases
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!