Skip to content

Commit 5f4fecf

Browse files
authored
Merge pull request matplotlib#29457 from timhoffm/doc-scalar-float
DOC: Use float instead for scalar for type descriptions in docstrings
2 parents 685ea2b + 339dfdc commit 5f4fecf

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

lib/matplotlib/artist.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ def set_alpha(self, alpha):
10161016
10171017
Parameters
10181018
----------
1019-
alpha : scalar or None
1019+
alpha : float or None
10201020
*alpha* must be within the 0-1 range, inclusive.
10211021
"""
10221022
if alpha is not None and not isinstance(alpha, Real):
@@ -1035,7 +1035,7 @@ def _set_alpha_for_array(self, alpha):
10351035
10361036
Parameters
10371037
----------
1038-
alpha : array-like or scalar or None
1038+
alpha : array-like or float or None
10391039
All values must be within the 0-1 range, inclusive.
10401040
Masked values and nans are not supported.
10411041
"""

lib/matplotlib/axes/_axes.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1613,7 +1613,7 @@ def plot(self, *args, scalex=True, scaley=True, data=None, **kwargs):
16131613
16141614
Parameters
16151615
----------
1616-
x, y : array-like or scalar
1616+
x, y : array-like or float
16171617
The horizontal / vertical coordinates of the data points.
16181618
*x* values are optional and default to ``range(len(y))``.
16191619
@@ -4231,13 +4231,13 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=None,
42314231
A list of dictionaries containing stats for each boxplot.
42324232
Required keys are:
42334233
4234-
- ``med``: Median (scalar).
4235-
- ``q1``, ``q3``: First & third quartiles (scalars).
4236-
- ``whislo``, ``whishi``: Lower & upper whisker positions (scalars).
4234+
- ``med``: Median (float).
4235+
- ``q1``, ``q3``: First & third quartiles (float).
4236+
- ``whislo``, ``whishi``: Lower & upper whisker positions (float).
42374237
42384238
Optional keys are:
42394239
4240-
- ``mean``: Mean (scalar). Needed if ``showmeans=True``.
4240+
- ``mean``: Mean (float). Needed if ``showmeans=True``.
42414241
- ``fliers``: Data beyond the whiskers (array-like).
42424242
Needed if ``showfliers=True``.
42434243
- ``cilo``, ``cihi``: Lower & upper confidence intervals
@@ -6872,7 +6872,7 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
68726872
``True``, then the histogram is normalized such that the first bin
68736873
equals 1.
68746874
6875-
bottom : array-like, scalar, or None, default: None
6875+
bottom : array-like or float, default: 0
68766876
Location of the bottom of each bin, i.e. bins are drawn from
68776877
``bottom`` to ``bottom + hist(x, bins)`` If a scalar, the bottom
68786878
of each bin is shifted by the same amount. If an array, each bin

lib/matplotlib/backend_bases.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,11 +428,11 @@ def draw_image(self, gc, x, y, im, transform=None):
428428
gc : `.GraphicsContextBase`
429429
A graphics context with clipping information.
430430
431-
x : scalar
431+
x : float
432432
The distance in physical units (i.e., dots or pixels) from the left
433433
hand side of the canvas.
434434
435-
y : scalar
435+
y : float
436436
The distance in physical units (i.e., dots or pixels) from the
437437
bottom side of the canvas.
438438

lib/matplotlib/backends/backend_mixed.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ def __init__(self, figure, width, height, dpi, vector_renderer,
2121
----------
2222
figure : `~matplotlib.figure.Figure`
2323
The figure instance.
24-
width : scalar
24+
width : float
2525
The width of the canvas in logical units
26-
height : scalar
26+
height : float
2727
The height of the canvas in logical units
2828
dpi : float
2929
The dpi of the canvas

lib/matplotlib/colors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ def __call__(self, X, alpha=None, bytes=False):
743743
r"""
744744
Parameters
745745
----------
746-
X : float or int, `~numpy.ndarray` or scalar
746+
X : float or int or array-like
747747
The data value(s) to convert to RGBA.
748748
For floats, *X* should be in the interval ``[0.0, 1.0]`` to
749749
return the RGBA values ``X*100`` percent along the Colormap line.
@@ -771,7 +771,7 @@ def _get_rgba_and_mask(self, X, alpha=None, bytes=False):
771771
r"""
772772
Parameters
773773
----------
774-
X : float or int, `~numpy.ndarray` or scalar
774+
X : float or int or array-like
775775
The data value(s) to convert to RGBA.
776776
For floats, *X* should be in the interval ``[0.0, 1.0]`` to
777777
return the RGBA values ``X*100`` percent along the Colormap line.
@@ -1609,7 +1609,7 @@ def __call__(self, X, alpha=None, bytes=False):
16091609
r"""
16101610
Parameters
16111611
----------
1612-
X : tuple (X0, X1), X0 and X1: float or int `~numpy.ndarray` or scalar
1612+
X : tuple (X0, X1), X0 and X1: float or int or array-like
16131613
The data value(s) to convert to RGBA.
16141614
16151615
- For floats, *X* should be in the interval ``[0.0, 1.0]`` to

0 commit comments

Comments
 (0)