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

Skip to content

Commit 7518845

Browse files
authored
Merge pull request #23871 from StefRe/DOC/fix_pick_event_demo
DOC: Fix formatting of pick event demo example
2 parents 06660ef + 751a9d2 commit 7518845

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

examples/event_handling/pick_event_demo.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
of the data within epsilon of the pick event
2222
2323
* function - if picker is callable, it is a user supplied function which
24-
determines whether the artist is hit by the mouse event.
24+
determines whether the artist is hit by the mouse event. ::
2525
2626
hit, props = picker(artist, mouseevent)
2727
@@ -31,7 +31,7 @@
3131
3232
After you have enabled an artist for picking by setting the "picker"
3333
property, you need to connect to the figure canvas pick_event to get
34-
pick callbacks on mouse press events. For example,
34+
pick callbacks on mouse press events. For example, ::
3535
3636
def pick_handler(event):
3737
mouseevent = event.mouseevent
@@ -42,15 +42,18 @@ def pick_handler(event):
4242
The pick event (matplotlib.backend_bases.PickEvent) which is passed to
4343
your callback is always fired with two attributes:
4444
45-
mouseevent - the mouse event that generate the pick event. The
46-
mouse event in turn has attributes like x and y (the coordinates in
47-
display space, such as pixels from left, bottom) and xdata, ydata (the
48-
coords in data space). Additionally, you can get information about
49-
which buttons were pressed, which keys were pressed, which Axes
50-
the mouse is over, etc. See matplotlib.backend_bases.MouseEvent
51-
for details.
45+
mouseevent
46+
the mouse event that generate the pick event.
5247
53-
artist - the matplotlib.artist that generated the pick event.
48+
The mouse event in turn has attributes like x and y (the coordinates in
49+
display space, such as pixels from left, bottom) and xdata, ydata (the
50+
coords in data space). Additionally, you can get information about
51+
which buttons were pressed, which keys were pressed, which Axes
52+
the mouse is over, etc. See matplotlib.backend_bases.MouseEvent
53+
for details.
54+
55+
artist
56+
the matplotlib.artist that generated the pick event.
5457
5558
Additionally, certain artists like Line2D and PatchCollection may
5659
attach additional meta data like the indices into the data that meet

0 commit comments

Comments
 (0)