diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index a5b7331d3777..6c1f7a2c4019 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -2996,24 +2996,21 @@ def test_hist_stacked_step(): ax.hist((d1, d2), histtype="step", stacked=True) -@image_comparison(baseline_images=['hist_stacked_normed']) -def test_hist_stacked_normed(): - # make some data - d1 = np.linspace(1, 3, 20) - d2 = np.linspace(0, 10, 50) - fig, ax = plt.subplots() - with pytest.warns(UserWarning): - ax.hist((d1, d2), stacked=True, normed=True) - - -@image_comparison(baseline_images=['hist_stacked_normed'], extensions=['png']) +@image_comparison(baseline_images=['hist_stacked_normed', + 'hist_stacked_normed']) def test_hist_stacked_density(): # make some data d1 = np.linspace(1, 3, 20) d2 = np.linspace(0, 10, 50) + fig, ax = plt.subplots() ax.hist((d1, d2), stacked=True, density=True) + # Also check that the old keyword works. + fig, ax = plt.subplots() + with pytest.warns(UserWarning): + ax.hist((d1, d2), stacked=True, normed=True) + @pytest.mark.parametrize('normed', [False, True]) @pytest.mark.parametrize('density', [False, True])