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

Skip to content

Commit 08bde66

Browse files
committed
fixed datalim update for fill_between
svn path=/trunk/matplotlib/; revision=6440
1 parent d44ffbf commit 08bde66

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

lib/matplotlib/axes.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5559,8 +5559,14 @@ def fill_between(self, x, y1, y2=0, where=None, **kwargs):
55595559

55605560
collection = mcoll.PolyCollection(polys, **kwargs)
55615561

5562-
self.update_datalim_numerix(x[where], y1[where])
5563-
self.update_datalim_numerix(x[where], y2[where])
5562+
# now update the datalim and autoscale
5563+
XY1 = np.array([x[where], y1[where]]).T
5564+
XY2 = np.array([x[where], y2[where]]).T
5565+
self.dataLim.update_from_data_xy(XY1, self.ignore_existing_data_limits,
5566+
updatex=True, updatey=True)
5567+
5568+
self.dataLim.update_from_data_xy(XY2, self.ignore_existing_data_limits,
5569+
updatex=False, updatey=True)
55645570
self.add_collection(collection)
55655571
self.autoscale_view()
55665572
return collection

0 commit comments

Comments
 (0)