Matplotlib - Interactive Features
Identify the error in this code snippet that tries to use pick events:
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
line, = ax.plot([1, 2, 3], [4, 5, 6])
def on_pick(event):
print('Picked:', event.artist)
fig.canvas.mpl_connect('pick_event', on_pick)
plt.show()