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

Skip to content

Commit 356cb4c

Browse files
committed
Merge pull request matplotlib#2113 from mdboom/histogram-step-unfilled-bottom-line
hist() bottom line now showing (regression?)
2 parents 567befa + 6a80742 commit 356cb4c

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

lib/matplotlib/axes.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8468,18 +8468,22 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None,
84688468
xvals.append(x.copy())
84698469
yvals.append(y.copy())
84708470

8471-
# add patches in reverse order so that when stacking,
8472-
# items lower in the stack are plottted on top of
8473-
# items higher in the stack
8474-
for x, y, c in reversed(zip(xvals, yvals, color)):
8475-
if fill:
8476-
patches.append(self.fill(x, y,
8477-
closed=True,
8478-
facecolor=c))
8479-
else:
8480-
patches.append(self.fill(x, y,
8481-
closed=True, edgecolor=c,
8482-
fill=False))
8471+
if fill:
8472+
# add patches in reverse order so that when stacking,
8473+
# items lower in the stack are plottted on top of
8474+
# items higher in the stack
8475+
for x, y, c in reversed(zip(xvals, yvals, color)):
8476+
patches.append(self.fill(
8477+
x, y,
8478+
closed=True,
8479+
facecolor=c))
8480+
else:
8481+
for x, y, c in reversed(zip(xvals, yvals, color)):
8482+
split = int(len(x) / 2) + 1
8483+
patches.append(self.fill(
8484+
x[:split], y[:split],
8485+
closed=False, edgecolor=c,
8486+
fill=False))
84838487

84848488
# we return patches, so put it back in the expected order
84858489
patches.reverse()

0 commit comments

Comments
 (0)