xBOUT
xBOUT copied to clipboard
Animation issues
Animations are a little tricky to use at the minute. I'm just dumping some info here, I'll try and fix some of these myself next week.
I get this warning a lot: /home/peter/.local/lib/python3.9/site-packages/matplotlib/animation.py:973: UserWarning: Animation was deleted without rendering anything. This is most likely unintended. To prevent deletion, assign the Animation to a variable that exists for as long as you need the Animation.
I'm pretty sure this is basically just a UX bug in matplotlib, but there's some gotchas:
- if you see this warning because you haven't assigned the result of
df.bout.animate*
to a variable, it seems impossible to get rid of it without recreating the dataset, e.g.df = df.squeeze()
- if you try to recreate an animation and assign it to an existing variable, you can still get the warning. You'll need to
del anim
to get it to work again
A suggested fix/workaround from the matplotlib github is to append new animations to a global list.
animate1D
silently fails if the dataset isn't 1D+time, while animate2D
fails if it isn't 2D+time. animate2D
has x
and y
arguments, so it should only fail if they aren't specified and the data has the wrong number of dimensions.