8000 MRG: expand docstring for `hist` by matthew-brett · Pull Request #9555 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

MRG: expand docstring for hist #9555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 24, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
DOC: expand docstring for hist
Remove reference of long-unsupported numpy version.

Explain what `bins` should be if a sequence.

Note half-open intervals for bins.
  • Loading branch information
matthew-brett committed Oct 24, 2017
commit 8295e710ff918748ecdb3c545e938095fdedb508
20 changes: 16 additions & 4 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5942,10 +5942,22 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
Input values, this takes either a single array or a sequency of
arrays which are not required to be of the same length

bins : integer or array_like or 'auto', optional
If an integer is given, ``bins + 1`` bin edges are returned,
consistently with :func:`numpy.histogram` for numpy version >=
1.3.
bins : integer or sequence or 'auto', optional
If an integer is given, ``bins + 1`` bin edges are calculated and
returned, consistent with :func:`numpy.histogram`.

If `bins` is a sequence, gives bin edges, including left edge of
first bin and right edge of last bin. In this case, `bins` is
returned unmodified.

All but the last (righthand-most) bin is half-open. In other
words, if `bins` is::

[1, 2, 3, 4]

then the first bin is ``[1, 2)`` (including 1, but excluding 2) and
the second ``[2, 3)``. The last bin, however, is ``[3, 4]``, which
*includes* 4.

Unequally spaced bins are supported if *bins* is a sequence.

Expand Down
0