Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f3895f9

Browse files
authored
Merge pull request #6614 from anntzer/fix-pickevent-docstring
Fix docstring for PickEvent.
2 parents 1214b21 + f7baa83 commit f3895f9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1576,13 +1576,13 @@ class PickEvent(Event):
15761576
15771577
Example usage::
15781578
1579-
line, = ax.plot(rand(100), 'o', picker=5) # 5 points tolerance
1579+
ax.plot(np.rand(100), 'o', picker=5) # 5 points tolerance
15801580
15811581
def on_pick(event):
1582-
thisline = event.artist
1583-
xdata, ydata = thisline.get_data()
1582+
line = event.artist
1583+
xdata, ydata = line.get_data()
15841584
ind = event.ind
1585-
print('on pick line:', zip(xdata[ind], ydata[ind]))
1585+
print('on pick line:', np.array([xdata[ind], ydata[ind]]).T)
15861586
15871587
cid = fig.canvas.mpl_connect('pick_event', on_pick)
15881588

0 commit comments

Comments
 (0)