File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 151
151
152
152
import matplotlib .cbook as cbook
153
153
from matplotlib import docstring
154
+ from matplotlib .path import Path
154
155
155
156
156
157
def logspace (xmin ,xmax ,N ):
@@ -2980,9 +2981,11 @@ def inside_poly(points, verts):
2980
2981
Return value is a sequence of indices into points for the points
2981
2982
that are inside the polygon.
2982
2983
"""
2983
- # PY3KTODO: Reimplement in terms of _path module
2984
- res , = np .nonzero (nxutils .points_inside_poly (points , verts ))
2985
- return res
2984
+ # Make a closed polygon path
2985
+ poly = Path ( verts )
2986
+
2987
+ # Check to see which points are contained withing the Path
2988
+ return [ idx for idx , p in enumerate (points ) if poly .contains_point (p ) ]
2986
2989
2987
2990
def poly_below (xmin , xs , ys ):
2988
2991
"""
You can’t perform that action at this time.
0 commit comments