22
33"""
44
5- You can enable picking by setting the"picker" property of an artist
6- (eg a matplotlib Line2D, Text, Patch, Polygon, AxesImage,
5+ You can enable picking by setting the "picker" property of an artist
6+ (for example, a matplotlib Line2D, Text, Patch, Polygon, AxesImage,
77etc...)
88
99There are a variety of meanings of the picker property
1515 the artist
1616
1717 float - if picker is a number it is interpreted as an
18- epsilon tolerance in points and the the artist will fire
18+ epsilon tolerance in points and the artist will fire
1919 off an event if it's data is within epsilon of the mouse
2020 event. For some artists like lines and patch collections,
2121 the artist may provide additional data to the pick event
22- that is generated, eg the indices of the data within
22+ that is generated, for example, the indices of the data within
2323 epsilon of the pick event
2424
25- function - if picker is callable, it is a user supplied
25+ function - if picker is callable, it is a user supplied
2626 function which determines whether the artist is hit by the
2727 mouse event.
2828
2929 hit, props = picker(artist, mouseevent)
3030
31- to determine the hit test. if the mouse event is over the
31+ to determine the hit test. If the mouse event is over the
3232 artist, return hit=True and props is a dictionary of properties
3333 you want added to the PickEvent attributes
3434
3535
3636After you have enabled an artist for picking by setting the "picker"
3737property, you need to connect to the figure canvas pick_event to get
38- pick callbacks on mouse press events. Eg ,
38+ pick callbacks on mouse press events. For example ,
3939
4040 def pick_handler(event):
4141 mouseevent = event.mouseevent
@@ -47,9 +47,9 @@ def pick_handler(event):
4747your callback is always fired with two attributes:
4848
4949 mouseevent - the mouse event that generate the pick event. The
50- mouse event in turn has attributes like x and y (the coords in
51- display space, eg pixels from left, bottom) and xdata, ydata (the
52- coords in data space). Additionaly , you can get information about
50+ mouse event in turn has attributes like x and y (the coordinates in
51+ display space, such as pixels from left, bottom) and xdata, ydata (the
52+ coords in data space). Additionally , you can get information about
5353 which buttons were pressed, which keys were pressed, which Axes
5454 the mouse is over, etc. See matplotlib.backend_bases.MouseEvent
5555 for details.
@@ -58,8 +58,8 @@ def pick_handler(event):
5858
5959Additionally, certain artists like Line2D and PatchCollection may
6060attach additional meta data like the indices into the data that meet
61- the picker criteria (eg all the points in the line that are within the
62- specified epsilon tolerance)
61+ the picker criteria (for example, all the points in the line that are within
62+ the specified epsilon tolerance)
6363
6464The examples below illustrate each of these methods.
6565"""
0 commit comments