@@ -613,6 +613,7 @@ def _start(self, *args):
613613 # actually start the event_source. We also disconnect _start
614614 # from the draw_events
615615 self .event_source .add_callback (self ._step )
616+ self ._init_draw ()
616617 self .event_source .start ()
617618 self ._fig .canvas .mpl_disconnect (self ._first_draw_id )
618619 self ._first_draw_id = None # So we can check on save
@@ -762,6 +763,9 @@ def save(self, filename, writer=None, fps=None, dpi=None, codec=None,
762763 # since GUI widgets are gone. Either need to remove extra code to
763764 # allow for this non-existant use case or find a way to make it work.
764765 with writer .saving (self ._fig , filename , dpi ):
766+ for anim in all_anim :
767+ # Clear the initial frame
768+ anim ._init_draw ()
765769 for data in zip (* [a .new_saved_frame_seq ()
766770 for a in all_anim ]):
767771 for anim , d in zip (all_anim , data ):
@@ -1135,7 +1139,10 @@ def new_saved_frame_seq(self):
11351139 # no saved frames, generate a new frame sequence and take the first
11361140 # save_count entries in it.
11371141 if self ._save_seq :
1138- return iter (self ._save_seq )
1142+ # While iterating we are going to update _save_seq
1143+ # so make a copy to safely iterate over
1144+ self ._old_saved_seq = self ._save_seq .copy ()
1145+ return iter (self ._old_saved_seq )
11391146 else :
11401147 return itertools .islice (self .new_frame_seq (), self .save_count )
11411148
0 commit comments