MCPcopy Create free account
hub / github.com/ColdGrub1384/Pyto / inside_poly

Function inside_poly

site-packages/matplotlib/mlab.py:3761–3773  ·  view source on GitHub ↗

*points* is a sequence of *x*, *y* points. *verts* is a sequence of *x*, *y* vertices of a polygon. Return value is a sequence of indices into points for the points that are inside the polygon.

(points, verts)

Source from the content-addressed store, hash-verified

3759##################################################
3760@cbook.deprecated("2.2")
3761def inside_poly(points, verts):
3762 """
3763 *points* is a sequence of *x*, *y* points.
3764 *verts* is a sequence of *x*, *y* vertices of a polygon.
3765
3766 Return value is a sequence of indices into points for the points
3767 that are inside the polygon.
3768 """
3769 # Make a closed polygon path
3770 poly = Path(verts)
3771
3772 # Check to see which points are contained within the Path
3773 return [idx for idx, p in enumerate(points) if poly.contains_point(p)]
3774
3775
3776@cbook.deprecated("2.2")

Callers

nothing calls this directly

Calls 2

contains_pointMethod · 0.95
PathClass · 0.90

Tested by

no test coverage detected