Skip to content

Commit 197bb59

Browse files
authored
Merge pull request #10831 from timhoffm/doc-binned
Minor docstring updates on binning related plot functions
2 parents 78224ef + b56e784 commit 197bb59

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

lib/matplotlib/axes/_axes.py

+25-25
Original file line numberDiff line numberDiff line change
@@ -4193,11 +4193,10 @@ def hexbin(self, x, y, C=None, gridsize=100, bins=None,
41934193
of the observations at (x[i],y[i]).
41944194
41954195
If *C* is specified, it specifies values at the coordinate
4196-
(x[i],y[i]). These values are accumulated for each hexagonal
4196+
(x[i], y[i]). These values are accumulated for each hexagonal
41974197
bin and then reduced according to *reduce_C_function*, which
4198-
defaults to numpy's mean function (np.mean). (If *C* is
4199-
specified, it must also be a 1-D sequence of the same length
4200-
as *x* and *y*.)
4198+
defaults to `numpy.mean`. (If *C* is specified, it must also
4199+
be a 1-D sequence of the same length as *x* and *y*.)
42014200
42024201
Parameters
42034202
----------
@@ -4213,7 +4212,7 @@ def hexbin(self, x, y, C=None, gridsize=100, bins=None,
42134212
tuple with two elements specifying the number of hexagons
42144213
in the *x*-direction and the *y*-direction.
42154214
4216-
bins : {'log'} or int or sequence, optional, default is *None*
4215+
bins : 'log' or int or sequence, optional, default is *None*
42174216
If *None*, no binning is applied; the color of each hexagon
42184217
directly corresponds to its count value.
42194218
@@ -4289,11 +4288,9 @@ def hexbin(self, x, y, C=None, gridsize=100, bins=None,
42894288
42904289
Returns
42914290
-------
4292-
object
4293-
a :class:`~matplotlib.collections.PolyCollection` instance; use
4294-
:meth:`~matplotlib.collections.PolyCollection.get_array` on
4295-
this :class:`~matplotlib.collections.PolyCollection` to get
4296-
the counts in each hexagon.
4291+
polycollection
4292+
A `.PolyCollection` instance; use `.PolyCollection.get_array` on
4293+
this to get the counts in each hexagon.
42974294
42984295
If *marginals* is *True*, horizontal
42994296
bar and vertical bar (both PolyCollections) will be attached
@@ -6060,11 +6057,11 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
60606057
----------
60616058
x : (n,) array or sequence of (n,) arrays
60626059
Input values, this takes either a single array or a sequence of
6063-
arrays which are not required to be of the same length
6060+
arrays which are not required to be of the same length.
60646061
6065-
bins : integer or sequence or 'auto', optional
6062+
bins : int or sequence or str, optional
60666063
If an integer is given, ``bins + 1`` bin edges are calculated and
6067-
returned, consistent with :func:`numpy.histogram`.
6064+
returned, consistent with `numpy.histogram`.
60686065
60696066
If `bins` is a sequence, gives bin edges, including left edge of
60706067
first bin and right edge of last bin. In this case, `bins` is
@@ -6081,9 +6078,12 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
60816078
60826079
Unequally spaced bins are supported if *bins* is a sequence.
60836080
6084-
If Numpy 1.11 is installed, may also be ``'auto'``.
6081+
With Numpy 1.11 or newer, you can alternatively provide a string
6082+
describing a binning strategy, such as 'auto', 'sturges', 'fd',
6083+
'doane', 'scott', 'rice', 'sturges' or 'sqrt', see
6084+
`numpy.histogram`.
60856085
6086-
Default is taken from the rcParam ``hist.bins``.
6086+
The default is taken from :rc:`hist.bins`.
60876087
60886088
range : tuple or None, optional
60896089
The lower and upper range of the bins. Lower and upper outliers
@@ -6096,7 +6096,7 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
60966096
60976097
Default is ``None``
60986098
6099-
density : boolean, optional
6099+
density : bool, optional
61006100
If ``True``, the first element of the return tuple will
61016101
be the counts normalized to form a probability density, i.e.,
61026102
the area (or integral) under the histogram will sum to 1.
@@ -6120,7 +6120,7 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
61206120
61216121
Default is ``None``
61226122
6123-
cumulative : boolean, optional
6123+
cumulative : bool, optional
61246124
If ``True``, then a histogram is computed where each bin gives the
61256125
counts in that bin plus all bins for smaller values. The last bin
61266126
gives the total number of datapoints. If *normed* or *density*
@@ -6180,7 +6180,7 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
61806180
61816181
Default is ``None``
61826182
6183-
log : boolean, optional
6183+
log : bool, optional
61846184
If ``True``, the histogram axis will be set to a log scale. If
61856185
*log* is ``True`` and *x* is a 1D array, empty bins will be
61866186
filtered out and only the non-empty ``(n, bins, patches)``
@@ -6194,14 +6194,14 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
61946194
61956195
Default is ``None``
61966196
6197-
label : string or None, optional
6197+
label : str or None, optional
61986198
String, or sequence of strings to match multiple datasets. Bar
61996199
charts yield multiple patches per dataset, but only the first gets
62006200
the label, so that the legend command will work as expected.
62016201
62026202
default is ``None``
62036203
6204-
stacked : boolean, optional
6204+
stacked : bool, optional
62056205
If ``True``, multiple data are stacked on top of each other If
62066206
``False`` multiple data are arranged side by side if histtype is
62076207
'bar' or on top of each other if histtype is 'step'
@@ -6555,10 +6555,10 @@ def hist2d(self, x, y, bins=10, range=None, normed=False, weights=None,
65556555
65566556
Parameters
65576557
----------
6558-
x, y: array_like, shape (n, )
6558+
x, y : array_like, shape (n, )
65596559
Input values
65606560
6561-
bins: [None | int | [int, int] | array_like | [array, array]]
6561+
bins : None or int or [int, int] or array_like or [array, array]
65626562
65636563
The bin specification:
65646564
@@ -6582,7 +6582,7 @@ def hist2d(self, x, y, bins=10, range=None, normed=False, weights=None,
65826582
xmax], [ymin, ymax]]. All values outside of this range will be
65836583
considered outliers and not tallied in the histogram.
65846584
6585-
normed : boolean, optional, default: False
6585+
normed : bool, optional, default: False
65866586
Normalize histogram.
65876587
65886588
weights : array_like, shape (n, ), optional, default: None
@@ -6612,7 +6612,7 @@ def hist2d(self, x, y, bins=10, range=None, normed=False, weights=None,
66126612
66136613
Other Parameters
66146614
----------------
6615-
cmap : {Colormap, string}, optional
6615+
cmap : Colormap or str, optional
66166616
A :class:`matplotlib.colors.Colormap` instance. If not set, use rc
66176617
settings.
66186618
@@ -6621,7 +6621,7 @@ def hist2d(self, x, y, bins=10, range=None, normed=False, weights=None,
66216621
scale luminance data to ``[0, 1]``. If not set, defaults to
66226622
``Normalize()``.
66236623
6624-
vmin/vmax : {None, scalar}, optional
6624+
vmin/vmax : None or scalar, optional
66256625
Arguments passed to the `Normalize` instance.
66266626
66276627
alpha : ``0 <= scalar <= 1`` or ``None``, optional

0 commit comments

Comments
 (0)