Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 40e3a90 commit db2e090Copy full SHA for db2e090
lib/matplotlib/mlab.py
@@ -2982,19 +2982,10 @@ def inside_poly(points, verts):
2982
that are inside the polygon.
2983
"""
2984
# Make a closed polygon path
2985
- codes = [ Path.LINETO ] * len(verts)
2986
- codes[ -1 ] = Path.CLOSEPOLY
2987
- p = Path( verts, codes )
+ poly = Path( verts )
2988
2989
# Check to see which points are contained withing the Path
2990
- res = []
2991
- idx = 0
2992
- while idx < len(points):
2993
- if p.contains_point( points[idx] ):
2994
- res.append( idx )
2995
- idx += 1
2996
-
2997
- return res
+ return [ idx for idx, p in enumerate(points) if poly.contains_point(p) ]
2998
2999
def poly_below(xmin, xs, ys):
3000
0 commit comments