diff --git a/examples/statistics/hist.py b/examples/statistics/hist.py index 98e1f95d43eb..a7e6473dd17c 100644 --- a/examples/statistics/hist.py +++ b/examples/statistics/hist.py @@ -63,7 +63,7 @@ thispatch.set_facecolor(color) # We can also normalize our inputs by the total number of counts -axs[1].hist(x, bins=n_bins, normed=True) +axs[1].hist(x, bins=n_bins, density=True) # Now we format the y-axis to display percentage axs[1].yaxis.set_major_formatter(PercentFormatter(xmax=1)) diff --git a/examples/statistics/histogram_features.py b/examples/statistics/histogram_features.py index 8c056c49d17c..598b1ca6864e 100644 --- a/examples/statistics/histogram_features.py +++ b/examples/statistics/histogram_features.py @@ -35,7 +35,7 @@ fig, ax = plt.subplots() # the histogram of the data -n, bins, patches = ax.hist(x, num_bins, normed=1) +n, bins, patches = ax.hist(x, num_bins, density=True) # add a 'best fit' line y = mlab.normpdf(bins, mu, sigma) diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index 34cba9d75c51..9378046d90f7 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -2932,7 +2932,7 @@ def test_hist_stacked_normed(): d2 = np.linspace(0, 10, 50) fig = plt.figure() ax = fig.add_subplot(111) - ax.hist((d1, d2), stacked=True, normed=True) + ax.hist((d1, d2), stacked=True, density=True) @image_comparison(baseline_images=['hist_stacked_normed'], extensions=['png']) diff --git a/tutorials/introductory/pyplot.py b/tutorials/introductory/pyplot.py index f2bc82e7beb4..d51d8338f457 100644 --- a/tutorials/introductory/pyplot.py +++ b/tutorials/introductory/pyplot.py @@ -333,8 +333,7 @@ def f(t): x = mu + sigma * np.random.randn(10000) # the histogram of the data -n, bins, patches = plt.hist(x, 50, normed=1, facecolor='g', alpha=0.75) - +n, bins, patches = plt.hist(x, 50, density=True, facecolor='g', alpha=0.75) plt.xlabel('Smarts') plt.ylabel('Probability')