dexplo / bar_chart_race

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

Only show entries above a certain threshold in the bar chart race #29

Open DataMikester opened 4 years ago

DataMikester commented 4 years ago

The package is super, thanks! I suggest implementing a feature to only show entries above a certain threshold in the bar chart race. To explain what I mean, let's consider the COVID-19 pandemic. Let's assume that I set the threshold to 0, i.e. only show countries with more that 0 COVID-19 cases/deaths. In the beginning, the bar chart race would only include China, but as the virus is spreading more and more countries would "enter" the bar chart race once the threshold is met. This would be a super useful feature in cases where many entries have zero (or low) starting values.

This could be combined with an "nminbars" parameter, which would overrule the threshold value, so that one could force minimum, say, 5 entries in the race, but more would be added once the threshold is met (until the nmaxbars is reached).