FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix slider widget polygon by cgohlke · Pull Request #576 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
7 changes: 6 additions & 1 deletion lib/matplotlib/patches.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,10 @@ def __init__(self, xy, closed=True, **kwargs):
Patch.__init__(self, **kwargs)
xy = np.asarray(xy, np.float_)
self._path = Path(xy)
self.set_closed(closed)
self._closed = closed
if closed and len(xy):
xy = np.concatenate([xy, [xy[0]]])
self._set_xy(xy)

def get_path(self):
return self._path
Expand All @@ -777,6 +780,8 @@ def get_closed(self):
return self._closed

def set_closed(self, closed):
if self._closed == bool(closed):
return
self._closed = closed
xy = self._get_xy()
if closed:
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/widgets.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,8 @@ def _update(self, event):

def set_val(self, val):
xy = self.poly.xy
xy[-1] = val, 0
xy[-2] = val, 1
xy[2] = val, 1
xy[3] = val, 0
self.poly.xy = xy
self.valtext.set_text(self.valfmt%val)
if self.drawon: self.ax.figure.canvas.draw()
Expand Down

Back | FazBrowse Home | New Git URL