Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6f7fa68

Browse files
committed
Close polygons.
svn path=/trunk/matplotlib/; revision=5405
1 parent 0ccc0a2 commit 6f7fa68

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lib/matplotlib/patches.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,9 @@ def __init__(self, xy, **kwargs):
540540
See Patch documentation for additional kwargs
541541
"""
542542
Patch.__init__(self, **kwargs)
543+
xy = np.asarray(xy, np.float_)
544+
if len(xy) and xy[0] != xy[-1]:
545+
xy = np.concatenate([xy, [xy[0]]])
543546
self._path = Path(xy)
544547
__init__.__doc__ = cbook.dedent(__init__.__doc__) % artist.kwdocd
545548

0 commit comments

Comments
 (0)