I made a Jupyter notebook to reproduce the awesome Washington Post article on social distancing (linked near the top of the next two links because apparently I can only include two links in a post). You can see it here and you can see the actual notebook here. My apologies if it’s not the prettiest code, but hopefully it’s not too atrocious. Anyway, now on to my question:
The code that generates the data is fast enough for me right now. The code that generates the animation is significantly slower. Any ideas on how to speed it up? I’m using a scatter plot, but I’d be happy with anything remotely similar that allows me to show particles over time, and allows them to change color.
For extra bonus points, There’s a stacked plot at the top of the animation. I tried to make it animated, and it made the whole thing unbearably slow. I’d love to animate it, but I couldn’t figure out how to do so decently. I’d be happy with anything that showed the trend in a similar way (vlines, etc).
I’m hoping this is an easy question, and I’m definitely aware that I’m no expert with matplotlib animations.
If it helps, I’m quite willing to try out someone else’s recommendation of streamlit.