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

Fix sliders by mdboom · Pull Request #581 · matplotlib/matplotlib · GitHub

Repository navigation

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

Filter by extension

Filter by extension .py  (3) 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
4 changes: 2 additions & 2 deletions lib/matplotlib/axes.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 @@ -3488,7 +3488,7 @@ def axhspan(self, ymin, ymax, xmin=0, xmax=1, **kwargs):
ymin, ymax = self.convert_yunits( [ymin, ymax] )

verts = (xmin, ymin), (xmin, ymax), (xmax, ymax), (xmax, ymin)
p = mpatches.Polygon(verts, **kwargs)
p = mpatches.Polygon(verts, closed=True, **kwargs)
p.set_transform(trans)
p.x_isdata = False
self.add_patch(p)
Expand Down Expand Up @@ -3545,7 +3545,7 @@ def axvspan(self, xmin, xmax, ymin=0, ymax=1, **kwargs):
ymin, ymax = self.convert_yunits( [ymin, ymax] )

verts = [(xmin, ymin), (xmin, ymax), (xmax, ymax), (xmax, ymin)]
p = mpatches.Polygon(verts, **kwargs)
p = mpatches.Polygon(verts, closed=True, **kwargs)
p.set_transform(trans)
p.y_isdata = False
self.add_patch(p)
Expand Down
9 changes: 5 additions & 4 deletions 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 @@ -778,14 +778,15 @@ def get_closed(self):

def set_closed(self, closed):
self._closed = closed
xy = self._get_xy()
new_xy = xy = self._get_xy()
if closed:
if len(xy) and (xy[0] != xy[-1]).any():
xy = np.concatenate([xy, [xy[0]]])
new_xy = np.concatenate([xy, [xy[0]]])
else:
if len(xy)>2 and (xy[0]==xy[-1]).all():
xy = xy[0:-1]
self._set_xy(xy)
new_xy = xy[0:-1]
if new_xy is not xy:
self._set_xy(new_xy)

def get_xy(self):
return self._path.vertices
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