@@ -127,6 +127,29 @@ def contains(self, mouseevent, radius=None):
127
127
"""
128
128
Test whether the mouse event occurred in the patch.
129
129
130
+ Parameters
131
+ ----------
132
+ mouseevent : `~matplotlib.backend_bases.MouseEvent`
133
+ Where the user clicked.
134
+
135
+ radius : float, optional
136
+ Additional margin on the patch in target coordinates of
137
+ `.Patch.get_transform`. See `.Path.contains_point` for further
138
+ details.
139
+
140
+ If `None`, the default value depends on the state of the object:
141
+
142
+ - If `.Artist.get_picker` is a number, the default
143
+ is that value. This is so that picking works as expected.
144
+ - Otherwise if the edge color has a non-zero alpha, the default
145
+ is half of the linewidth. This is so that all the colored
146
+ pixels are "in" the patch.
147
+ - Finally, if the edge has 0 alpha, the default is 0. This is
148
+ so that patches without a stroked edge do not have points
149
+ outside of the filled region report as "in" due to an
150
+ invisible edge.
151
+
152
+
130
153
Returns
131
154
-------
132
155
(bool, empty dict)
@@ -160,13 +183,25 @@ def contains_point(self, point, radius=None):
160
183
----------
161
184
point : (float, float)
162
185
The point (x, y) to check, in target coordinates of
163
- ``self .get_transform()``. These are display coordinates for patches
186
+ ``.Patch .get_transform()``. These are display coordinates for patches
164
187
that are added to a figure or Axes.
165
188
radius : float, optional
166
189
Additional margin on the patch in target coordinates of
167
- ``self. get_transform()` `. See `.Path.contains_point` for further
190
+ `.Patch. get_transform`. See `.Path.contains_point` for further
168
191
details.
169
192
193
+ If `None`, the default value depends on the state of the object:
194
+
195
+ - If `.Artist.get_picker` is a number, the default
196
+ is that value. This is so that picking works as expected.
197
+ - Otherwise if the edge color has a non-zero alpha, the default
198
+ is half of the linewidth. This is so that all the colored
199
+ pixels are "in" the patch.
200
+ - Finally, if the edge has 0 alpha, the default is 0. This is
201
+ so that patches without a stroked edge do not have points
202
+ outside of the filled region report as "in" due to an
203
+ invisible edge.
204
+
170
205
Returns
171
206
-------
172
207
bool
@@ -214,9 +249,21 @@ def contains_points(self, points, radius=None):
214
249
that are added to a figure or Axes. Columns contain x and y values.
215
250
radius : float, optional
216
251
Additional margin on the patch in target coordinates of
217
- ``self. get_transform()` `. See `.Path.contains_point` for further
252
+ `.Patch. get_transform`. See `.Path.contains_point` for further
218
253
details.
219
254
255
+ If `None`, the default value depends on the state of the object:
256
+
257
+ - If `.Artist.get_picker` is a number, the default
258
+ is that value. This is so that picking works as expected.
259
+ - Otherwise if the edge color has a non-zero alpha, the default
260
+ is half of the linewidth. This is so that all the colored
261
+ pixels are "in" the patch.
262
+ - Finally, if the edge has 0 alpha, the default is 0. This is
263
+ so that patches without a stroked edge do not have points
264
+ outside of the filled region report as "in" due to an
265
+ invisible edge.
266
+
220
267
Returns
221
268
-------
222
269
length-N bool array
0 commit comments