8000 Merge pull request #9555 from matthew-brett/hist-bins-doc · matplotlib/matplotlib@7f88c65 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7f88c65

Browse files
authored
Merge pull request #9555 from matthew-brett/hist-bins-doc
MRG: expand docstring for `hist`
2 parents 9e31bd9 + 8295e71 commit 7f88c65

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

0 commit comments

Comments
 (0)
0