dexplo / bar_chart_race

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

Bars Overlap Each Other During Animation #23

Closed andresberejnoi closed 4 years ago

andresberejnoi commented 4 years ago

Hello, I have been trying this library to animate data I collected about my puppies while they were growing. However, I have a problem where many of the bars overlap with each other.

The dataset has 9 different dogs, and about 200 data points per dog (there are many NaN values in between). Do you have any suggestions about what could be the issue?

andresberejnoi commented 4 years ago

Could it be the NaN values messing with the code?

kuharan commented 4 years ago

Try using df.fillna(method='ffill') and df.fillna(method='bfill') or interpolation ; whichever works best for your case.

tdpetrou commented 4 years ago

Hi Andres, I haven't really tested data with lots of missing values and as @kuharan mentioned, its best to fill them in before doing the race. Can you attach the dataset here in a separate post (or link to it)? Thanks!

andresberejnoi commented 4 years ago

Thanks. I tested by just filling all missing values with interpolation and the problem was solved. I will close this issue. I have another question about using images for lables, but I think I will open a separate issue for that.