From 2a1958b9fa71437de308a63f2badd05d2f7f7f44 Mon Sep 17 00:00:00 2001 From: hannah Date: Fri, 14 Oct 2022 09:48:16 -0400 Subject: [PATCH] Backport PR #24164: Fix argument order in hist() docstring. --- lib/matplotlib/axes/_axes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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::