Skip to content

Reword hist() doc. #15385

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 6, 2019
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
30 changes: 14 additions & 16 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6354,7 +6354,10 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
a 2-D ndarray in which each column is a dataset. Note that
the ndarray form is transposed relative to the list form.

Masked arrays are not supported at present.
Masked arrays are not supported.

The *bins*, *range*, *weights*, and *density* parameters behave as in
`numpy.histogram`.

Parameters
----------
Expand All @@ -6363,30 +6366,25 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
arrays which are not required to be of the same length.

bins : int or sequence or str, optional
If an integer is given, ``bins + 1`` bin edges are calculated and
returned, consistent with `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.
If *bins* is an integer, it defines the number of equal-width bins
in the range.

All but the last (righthand-most) bin is half-open. In other
words, if *bins* is::
If *bins* is a sequence, it defines the bin edges, including the
left edge of the first bin and the right edge of the last bin;
in this case, bins may be unequally spaced. 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.

With Numpy 1.11 or newer, you can alternatively provide a string
describing a binning strategy, such as 'auto', 'sturges', 'fd',
'doane', 'scott', 'rice' or 'sqrt', see
`numpy.histogram`.
If *bins* is a string, it is one of the binning strategies
supported by `numpy.histogram_bin_edges`: 'auto', 'fd', 'doane',
'scott', 'stone', 'rice', 'sturges', or 'sqrt'.

The default is taken from :rc:`hist.bins`.
The default is :rc:`hist.bins`.

range : tuple or None, optional
The lower and upper range of the bins. Lower and upper outliers
Expand Down