8000 Fix docstring for PickEvent. · matplotlib/matplotlib@f7baa83 · GitHub
[go: up one dir, main page]

Skip to content

Commit f7baa83

Browse files
committed
Fix docstring for PickEvent.
`zip(...)` does not print out nicely under Python 3.
1 parent 1214b21 commit f7baa83

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)
0