Skip to content

Commit

Permalink
Work around end-point duplication bug in Matplotlib
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanv committed Feb 2, 2016
1 parent bf7e885 commit be667e0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion skimage/_shared/_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ def clip_to_bbox(poly_path, bbox, inside=True):

poly = path.Path(np.vstack((rp, cp)).T, closed=True)
clip_rect = transforms.Bbox([[r0, c0], [r1, c1]])

poly_clipped = clip_to_bbox(poly, clip_rect).to_polygons()[0]

if np.all(poly_clipped[-1] == poly_clipped[-2]):
poly_clipped = poly_clipped[:-1]

return poly_clipped[:, 0], poly_clipped[:, 1]


Expand Down

0 comments on commit be667e0

Please sign in to comment.