From 728db5521cd8f8db8a17aff79eae98b33298d461 Mon Sep 17 00:00:00 2001 From: Jens Hedegaard Nielsen Date: Wed, 4 Nov 2015 22:22:41 +0000 Subject: [PATCH] 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 --- lib/matplotlib/animation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/animation.py b/lib/matplotlib/animation.py index 8f78688f221b..a44ed865cd43 100644 --- a/lib/matplotlib/animation.py +++ b/lib/matplotlib/animation.py @@ -771,7 +771,8 @@ def save(self, filename, writer=None, fps=None, dpi=None, codec=None, with writer.saving(self._fig, filename, dpi): for anim in all_anim: # Clear the initial frame - anim._init_draw() + if anim._init_func: + anim._init_draw() for data in zip(*[a.new_saved_frame_seq() for a in all_anim]): for anim, d in zip(all_anim, data):