Skip to content

Commit

Permalink
Make edgecolors and facecolors the same when using stepfilled histogram.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carreau committed May 28, 2016
1 parent 14664e2 commit 94cf4c7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/matplotlib/axes/_axes.py
Expand Up @@ -6292,8 +6292,8 @@ def _normalize_input(inp, ename='input'):
facecolor=c,
margins=margins))
else:
for x, y, c in reversed(list(zip(xvals, yvals, color))):
split = 2 * len(bins)
split = 2 * len(bins)
for x, y, c in reversed(list(zip(xvals, yvals, reversed(color)))):
patches.append(self.fill(
x[:split], y[:split],
closed=False, edgecolor=c,
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions lib/matplotlib/tests/test_axes.py
Expand Up @@ -1150,6 +1150,16 @@ def test_hist_steplog():
ax = plt.subplot(4, 1, 4)
plt.hist(data_big, 100, histtype='stepfilled', log=True, orientation='horizontal')

@image_comparison(baseline_images=['hist_step_filled'], extensions=['png'])
def test_hist_step_empty():
import numpy as np
import matplotlib.pyplot as plt
x = np.random.randn(1000, 3)
fig, ax = plt.subplots()
ax.hist(x, n_bins, histtype='step', fill=True, stacked=True)
patches= ax.patches
all([p.get_facecolor() == p.get_edgecolor() for p in patches])


@image_comparison(baseline_images=['hist_step_log_bottom'],
remove_text=True, extensions=['png'])
Expand Down

0 comments on commit 94cf4c7

Please sign in to comment.