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 151151
152152import matplotlib .cbook as cbook
153153from matplotlib import docstring
154+ from matplotlib .path import Path
154155
155156
156157def logspace (xmin ,xmax ,N ):
@@ -2980,9 +2981,11 @@ def inside_poly(points, verts):
29802981 Return value is a sequence of indices into points for the points
29812982 that are inside the polygon.
29822983 """
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 ) ]
29862989
29872990def poly_below (xmin , xs , ys ):
29882991 """
You can’t perform that action at this time.
0 commit comments