8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1214b21 commit f7baa83Copy full SHA for f7baa83
lib/matplotlib/backend_bases.py
@@ -1576,13 +1576,13 @@ class PickEvent(Event):
1576
1577
Example usage::
1578
1579
- line, = ax.plot(rand(100), 'o', picker=5) # 5 points tolerance
+ ax.plot(np.rand(100), 'o', picker=5) # 5 points tolerance
1580
1581
def on_pick(event):
1582
- thisline = event.artist
1583
- xdata, ydata = thisline.get_data()
+ line = event.artist
+ xdata, ydata = line.get_data()
1584
ind = event.ind
1585
- print('on pick line:', zip(xdata[ind], ydata[ind]))
+ print('on pick line:', np.array([xdata[ind], ydata[ind]]).T)
1586
1587
cid = fig.canvas.mpl_connect('pick_event', on_pick)
1588
0 commit comments