@@ -613,6 +613,7 @@ def _start(self, *args):
613
613
# actually start the event_source. We also disconnect _start
614
614
# from the draw_events
615
615
self .event_source .add_callback (self ._step )
616
+ self ._init_draw ()
616
617
self .event_source .start ()
617
618
self ._fig .canvas .mpl_disconnect (self ._first_draw_id )
618
619
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,
762
763
# since GUI widgets are gone. Either need to remove extra code to
763
764
# allow for this non-existant use case or find a way to make it work.
764
765
with writer .saving (self ._fig , filename , dpi ):
766
+ for anim in all_anim :
767
+ # Clear the initial frame
768
+ anim ._init_draw ()
765
769
for data in zip (* [a .new_saved_frame_seq ()
766
770
for a in all_anim ]):
767
771
for anim , d in zip (all_anim , data ):
@@ -1135,7 +1139,10 @@ def new_saved_frame_seq(self):
1135
1139
# no saved frames, generate a new frame sequence and take the first
1136
1140
# save_count entries in it.
1137
1141
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 )
1139
1146
else :
1140
1147
return itertools .islice (self .new_frame_seq (), self .save_count )
1141
1148
0 commit comments