|
12 | 12 | from matplotlib._path import point_in_path, get_path_extents, \ |
13 | 13 | point_in_path_collection, get_path_collection_extents, \ |
14 | 14 | path_in_path, path_intersects_path, convert_path_to_polygons, \ |
15 | | - cleanup_path |
| 15 | + cleanup_path, points_in_path |
16 | 16 | from matplotlib.cbook import simple_linear_interpolation, maxdict |
17 | 17 | from matplotlib import rcParams |
18 | 18 |
|
@@ -280,12 +280,31 @@ def contains_point(self, point, transform=None, radius=0.0): |
280 | 280 |
|
281 | 281 | If *transform* is not *None*, the path will be transformed |
282 | 282 | before performing the test. |
| 283 | +
|
| 284 | + *radius* allows the path to be made slightly larger or |
| 285 | + smaller. |
283 | 286 | """ |
284 | 287 | if transform is not None: |
285 | 288 | transform = transform.frozen() |
286 | 289 | result = point_in_path(point[0], point[1], radius, self, transform) |
287 | 290 | return result |
288 | 291 |
|
| 292 | + def contains_points(self, points, transform=None, radius=0.0): |
| 293 | + """ |
| 294 | + Returns a bool array which is *True* if the path contains the |
| 295 | + corresponding point. |
| 296 | +
|
| 297 | + If *transform* is not *None*, the path will be transformed |
| 298 | + before performing the test. |
| 299 | +
|
| 300 | + *radius* allows the path to be made slightly larger or |
| 301 | + smaller. |
| 302 | + """ |
| 303 | + if transform is not None: |
| 304 | + transform = transform.frozen() |
| 305 | + result = points_in_path(points, radius, self, transform) |
| 306 | + return result |
| 307 | + |
289 | 308 | def contains_path(self, path, transform=None): |
290 | 309 | """ |
291 | 310 | Returns *True* if this path completely contains the given path. |
|
0 commit comments