Skip to content

Commit b56e784

Browse files
committed
Minor docstring updates on binning related plot functions
1 parent 4257416 commit b56e784

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
@@ -4191,11 +4191,10 @@ def hexbin(self, x, y, C=None, gridsize=100, bins=None,
41914191
of the observations at (x[i],y[i]).
41924192
41934193
If *C* is specified, it specifies values at the coordinate
4194-
(x[i],y[i]). These values are accumulated for each hexagonal
4194+
(x[i], y[i]). These values are accumulated for each hexagonal
41954195
bin and then reduced according to *reduce_C_function*, which
4196-
defaults to numpy's mean function (np.mean). (If *C* is
4197-
specified, it must also be a 1-D sequence of the same length
4198-
as *x* and *y*.)
4196+
defaults to `numpy.mean`. (If *C* is specified, it must also
4197+
be a 1-D sequence of the same length as *x* and *y*.)
41994198
42004199
Parameters
42014200
----------
@@ -4211,7 +4210,7 @@ def hexbin(self, x, y, C=None, gridsize=100, bins=None,
42114210
tuple with two elements specifying the number of hexagons
42124211
in the *x*-direction and the *y*-direction.
42134212
4214-
bins : {'log'} or int or sequence, optional, default is *None*
4213+
bins : 'log' or int or sequence, optional, default is *None*
42154214
If *None*, no binning is applied; the color of each hexagon
42164215
directly corresponds to its count value.
42174216
@@ -4287,11 +4286,9 @@ def hexbin(self, x, y, C=None, gridsize=100, bins=None,
42874286
42884287
Returns
42894288
-------
4290-
object
4291-
a :class:`~matplotlib.collections.PolyCollection` instance; use
4292-
:meth:`~matplotlib.collections.PolyCollection.get_array` on
4293-
this :class:`~matplotlib.collections.PolyCollection` to get
4294-
the counts in each hexagon.
4289+
polycollection
4290+
A `.PolyCollection` instance; use `.PolyCollection.get_array` on
4291+
this to get the counts in each hexagon.
42954292
42964293
If *marginals* is *True*, horizontal
42974294
bar and vertical bar (both PolyCollections) will be attached
@@ -6058,11 +6055,11 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
60586055
----------
60596056
x : (n,) array or sequence of (n,) arrays
60606057
Input values, this takes either a single array or a sequence of
6061-
arrays which are not required to be of the same length
6058+
arrays which are not required to be of the same length.
60626059
6063-
bins : integer or sequence or 'auto', optional
6060+
bins : int or sequence or str, optional
60646061
If an integer is given, ``bins + 1`` bin edges are calculated and
6065-
returned, consistent with :func:`numpy.histogram`.
6062+
returned, consistent with `numpy.histogram`.
60666063
60676064
If `bins` is a sequence, gives bin edges, including left edge of
60686065
first bin and right edge of last bin. In this case, `bins` is
@@ -6079,9 +6076,12 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
60796076
60806077
Unequally spaced bins are supported if *bins* is a sequence.
60816078
6082-
If Numpy 1.11 is installed, may also be ``'auto'``.
6079+
With Numpy 1.11 or newer, you can alternatively provide a string
6080+
describing a binning strategy, such as 'auto', 'sturges', 'fd',
6081+
'doane', 'scott', 'rice', 'sturges' or 'sqrt', see
6082+
`numpy.histogram`.
60836083
6084-
Default is taken from the rcParam ``hist.bins``.
6084+
The default is taken from :rc:`hist.bins`.
60856085
60866086
range : tuple or None, optional
60876087
The lower and upper range of the bins. Lower and upper outliers
@@ -6094,7 +6094,7 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
60946094
60956095
Default is ``None``
60966096
6097-
density : boolean, optional
6097+
density : bool, optional
60986098
If ``True``, the first element of the return tuple will
60996099
be the counts normalized to form a probability density, i.e.,
61006100
the area (or integral) under the histogram will sum to 1.
@@ -6118,7 +6118,7 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
61186118
61196119
Default is ``None``
61206120
6121-
cumulative : boolean, optional
6121+
cumulative : bool, optional
61226122
If ``True``, then a histogram is computed where each bin gives the
61236123
counts in that bin plus all bins for smaller values. The last bin
61246124
gives the total number of datapoints. If *normed* or *density*
@@ -6178,7 +6178,7 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
61786178
61796179
Default is ``None``
61806180
6181-
log : boolean, optional
6181+
log : bool, optional
61826182
If ``True``, the histogram axis will be set to a log scale. If
61836183
*log* is ``True`` and *x* is a 1D array, empty bins will be
61846184
filtered out and only the non-empty ``(n, bins, patches)``
@@ -6192,14 +6192,14 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
61926192
61936193
Default is ``None``
61946194
6195-
label : string or None, optional
6195+
label : str or None, optional
61966196
String, or sequence of strings to match multiple datasets. Bar
61976197
charts yield multiple patches per dataset, but only the first gets
61986198
the label, so that the legend command will work as expected.
61996199
62006200
default is ``None``
62016201
6202-
stacked : boolean, optional
6202+
stacked : bool, optional
62036203
If ``True``, multiple data are stacked on top of each other If
62046204
``False`` multiple data are arranged side by side if histtype is
62056205
'bar' or on top of each other if histtype is 'step'
@@ -6553,10 +6553,10 @@ def hist2d(self, x, y, bins=10, range=None, normed=False, weights=None,
65536553
65546554
Parameters
65556555
----------
6556-
x, y: array_like, shape (n, )
6556+
x, y : array_like, shape (n, )
65576557
Input values
65586558
6559-
bins: [None | int | [int, int] | array_like | [array, array]]
6559+
bins : None or int or [int, int] or array_like or [array, array]
65606560
65616561
The bin specification:
65626562
@@ -6580,7 +6580,7 @@ def hist2d(self, x, y, bins=10, range=None, normed=False, weights=None,
65806580
xmax], [ymin, ymax]]. All values outside of this range will be
65816581
considered outliers and not tallied in the histogram.
65826582
6583-
normed : boolean, optional, default: False
6583+
normed : bool, optional, default: False
65846584
Normalize histogram.
65856585
65866586
weights : array_like, shape (n, ), optional, default: None
@@ -6610,7 +6610,7 @@ def hist2d(self, x, y, bins=10, range=None, normed=False, weights=None,
66106610
66116611
Other Parameters
66126612
----------------
6613-
cmap : {Colormap, string}, optional
6613+
cmap : Colormap or str, optional
66146614
A :class:`matplotlib.colors.Colormap` instance. If not set, use rc
66156615
settings.
66166616
@@ -6619,7 +6619,7 @@ def hist2d(self, x, y, bins=10, range=None, normed=False, weights=None,
66196619
scale luminance data to ``[0, 1]``. If not set, defaults to
66206620
``Normalize()``.
66216621
6622-
vmin/vmax : {None, scalar}, optional
6622+
vmin/vmax : None or scalar, optional
66236623
Arguments passed to the `Normalize` instance.
66246624
66256625
alpha : ``0 <= scalar <= 1`` or ``None``, optional

0 commit comments

Comments
 (0)