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

Skip to content

Commit b71447f

Browse files
committed
Remove test_mouseclicks and copy some bits to docs.
The name is getting collected as a test by pytest when it isn't one, and it isn't much of an example anyway.
1 parent bdb8682 commit b71447f

File tree

2 files changed

+4
-36
lines changed

2 files changed

+4
-36
lines changed

doc/users/event_handling.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ connect your function to the event manager, which is part of the
2929
example that prints the location of the mouse click and which button
3030
was pressed::
3131

32-
fig = plt.figure()
33-
ax = fig.add_subplot(111)
32+
fig, ax = plt.subplots()
3433
ax.plot(np.random.rand(10))
3534

3635
def onclick(event):
37-
print('button=%d, x=%d, y=%d, xdata=%f, ydata=%f' %
38-
(event.button, event.x, event.y, event.xdata, event.ydata))
36+
print('%s click: button=%d, x=%d, y=%d, xdata=%f, ydata=%f' %
37+
('double' if event.dblclick else 'single', event.button,
38+
event.x, event.y, event.xdata, event.ydata))
3939

4040
cid = fig.canvas.mpl_connect('button_press_event', onclick)
4141

examples/event_handling/test_mouseclicks.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)