8000 Backport PR #9555: MRG: expand docstring for `hist` · matplotlib/matplotlib@039af0f · GitHub
[go: up one dir, main page]

Skip to content

Commit 039af0f

Browse files
NelleVMeeseeksDev[bot]
authored andcommitted
Backport PR #9555: MRG: expand docstring for hist
1 parent 5986519 commit 039af0f

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5943,10 +5943,22 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
5943 8000 5943
Input values, this takes either a single array or a sequency of
59445944
arrays which are not required to be of the same length
59455945
5946-
bins : integer or array_like or 'auto', optional
5947-
If an integer is given, ``bins + 1`` bin edges are returned,
5948-
consistently with :func:`numpy.histogram` for numpy version >=
5949-
1.3.
5946+
bins : integer or sequence or 'auto', optional
5947+
If an integer is given, ``bins + 1`` bin edges are calculated and
5948+
returned, consistent with :func:`numpy.histogram`.
5949+
5950+
If `bins` is a sequence, gives bin edges, including left edge of
5951+
first bin and right edge of last bin. In this case, `bins` is
5952+
returned unmodified.
5953+
5954+
All but the last (righthand-most) bin is half-open. In other
5955+
words, if `bins` is::
5956+
5957+
[1, 2, 3, 4]
5958+
5959+
then the first bin is ``[1, 2)`` (including 1, but excluding 2) and
5960+
the second ``[2, 3)``. The last bin, however, is ``[3, 4]``, which
5961+
*includes* 4.
59505962
59515963
Unequally spaced bins are supported if *bins* is a sequence.
59525964

0 commit comments

Comments
 (0)
0