diff --git a/lib/matplotlib/animation.py b/lib/matplotlib/animation.py index a87f00201124..97e2cbc64ede 100644 --- a/lib/matplotlib/animation.py +++ b/lib/matplotlib/animation.py @@ -891,6 +891,7 @@ def __init__(self, fig, event_source=None, blit=False): # that cause the frame sequence to be iterated. self.frame_seq = self.new_frame_seq() self.event_source = event_source + self.event_source.add_callback(self._step) # Instead of starting the event source now, we connect to the figure's # draw_event, so that we only start once the figure has been drawn. @@ -923,13 +924,9 @@ def _start(self, *args): return # First disconnect our draw event handler self._fig.canvas.mpl_disconnect(self._first_draw_id) - # Now do any initial draw self._init_draw() - - # Add our callback for stepping the animation and - # actually start the event_source. - self.event_source.add_callback(self._step) + # Actually start the event_source. self.event_source.start() def _stop(self, *args):