October 2018
Beginner to intermediate
676 pages
18h 30m
English
The following steps explain how to code the required logic:
t = np.arange(0.0, 1.0, 0.01)s = np.sin(2 * np.pi * t)
fig, ax = plt.subplots()
ax.plot(t, s)
str_time = time()
def on_move(event): if event.inaxes: print('onmove data coords %.2f %.2f' % (event.xdata, event.ydata)) elapsed_time = time() - str_time print('elapsed time', elapsed_time) if elapsed_time > 10: print('Closing onmove event after 10 sec') plt.disconnect(binding_id)
Read now
Unlock full access