Pyplot connect to timer event?
- by Baron Yugovich
The same way I now have plt.connect('button_press_event', self.on_click)
I would like to have something like plt.connect('each_five_seconds_event', self.on_timer)
How can I achieve this in a way that's most similar to what I've shown above?
EDIT:
I tried
fig = plt.subplot2grid((num_cols, num_rows), (col, row), rowspan=rowspan,
colspan=colspan)
timer = fig.canvas.new_timer(interval=100, callbacks=[(self.on_click)])
timer.start()
And got
AttributeError: 'AxesSubplot' object has no attribute 'canvas'