Skip to content

Commit 728db55

Browse files
committed
Only call init function at the begining of a save when user supplied
If a user supplied function is given it is probably needed to restart the animation. The default just inserts the first frame and restarts the animation which is not useful. Fixes #5399
1 parent e6c6c00 commit 728db55

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/animation.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,8 @@ def save(self, filename, writer=None, fps=None, dpi=None, codec=None,
771771
with writer.saving(self._fig, filename, dpi):
772772
for anim in all_anim:
773773
# Clear the initial frame
774-
anim._init_draw()
774+
if anim._init_func:
775+
anim._init_draw()
775776
for data in zip(*[a.new_saved_frame_seq()
776777
for a in all_anim]):
777778
for anim, d in zip(all_anim, data):

0 commit comments

Comments
 (0)