8000 Merge remote-tracking branch 'upstream/v1.3.x' · matplotlib/matplotlib@97b5251 · GitHub
[go: up one dir, main page]

Skip to content

Commit 97b5251

Browse files
committed
Merge remote-tracking branch 'upstream/v1.3.x'
2 parents 4d53538 + 53573c9 commit 97b5251

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5654,10 +5654,11 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None,
56545654
if log:
56555655
y[y < minimum] = minimum
56565656
if orientation == 'horizontal':
5657-
x, y = y, x
5658-
5659-
xvals.append(x.copy())
5660-
yvals.append(y.copy())
5657+
xvals.append(y.copy())
5658+
yvals.append(x.copy())
5659+
else:
5660+
xvals.append(x.copy())
5661+
yvals.append(y.copy())
56615662

56625663
if fill:
56635664
# add patches in reverse order so that when stacking,
Loading

lib/matplotlib/tests/test_axes.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1473,6 +1473,16 @@ def test_hist_step():
14731473
ax.set_xlim(-1, 5)
14741474

14751475

1476+
@image_comparison(baseline_images=['hist_step_horiz'], extensions=['png'])
1477+
def test_hist_step_horiz():
1478+
# make some data
1479+
d1 = np.linspace(0, 10, 50)
1480+
d2 = np.linspace(1, 3, 20)
1481+
fig = plt.figure()
1482+
ax = fig.add_subplot(111)
1483+
ax.hist( (d1, d2), histtype="step", orientation="horizontal")
1484+
1485+
14761486
@image_comparison(baseline_images=['hist_stacked_weights'])
14771487
def test_hist_stacked_weighted():
14781488
# make some data

0 commit comments

Comments
 (0)
0