21
21
of the data within epsilon of the pick event
22
22
23
23
* 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. ::
25
25
26
26
hit, props = picker(artist, mouseevent)
27
27
31
31
32
32
After you have enabled an artist for picking by setting the "picker"
33
33
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, ::
35
35
36
36
def pick_handler(event):
37
37
mouseevent = event.mouseevent
@@ -42,15 +42,18 @@ def pick_handler(event):
42
42
The pick event (matplotlib.backend_bases.PickEvent) which is passed to
43
43
your callback is always fired with two attributes:
44
44
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.
52
47
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.
54
57
55
58
Additionally, certain artists like Line2D and PatchCollection may
56
59
attach additional meta data like the indices into the data that meet
0 commit comments