diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index d8ac2bb829f3..a3acc5175b30 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -6432,7 +6432,7 @@ def hist(self, x, bins=None, range=None, density=False, weights=None, `~.stairs` to plot the distribution:: counts, bins = np.histogram(x) - plt.stairs(bins, counts) + plt.stairs(counts, bins) Alternatively, plot pre-computed bins and counts using ``hist()`` by treating each bin as a single point with a weight equal to its count::