Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0d6fd56

Browse files
authored
Use array-like in docs (#14715)
Use array-like in docs
2 parents 8e129df + 89b41cd commit 0d6fd56

File tree

14 files changed

+72
-72
lines changed

14 files changed

+72
-72
lines changed

examples/statistics/confidence_ellipse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def confidence_ellipse(x, y, ax, n_std=3.0, facecolor='none', **kwargs):
4444
4545
Parameters
4646
----------
47-
x, y : array_like, shape (n, )
47+
x, y : array-like, shape (n, )
4848
Input data.
4949
5050
ax : matplotlib.axes.Axes

lib/matplotlib/axes/_axes.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,11 +1053,11 @@ def hlines(self, y, xmin, xmax, colors='k', linestyles='solid',
10531053
y : scalar or sequence of scalar
10541054
y-indexes where to plot the lines.
10551055
1056-
xmin, xmax : scalar or 1D array_like
1056+
xmin, xmax : scalar or 1D array-like
10571057
Respective beginning and end of each line. If scalars are
10581058
provided, all lines will have same length.
10591059
1060-
colors : array_like of colors, optional, default: 'k'
1060+
colors : array-like of colors, optional, default: 'k'
10611061
10621062
linestyles : {'solid', 'dashed', 'dashdot', 'dotted'}, optional
10631063
@@ -1128,14 +1128,14 @@ def vlines(self, x, ymin, ymax, colors='k', linestyles='solid',
11281128
11291129
Parameters
11301130
----------
1131-
x : scalar or 1D array_like
1131+
x : scalar or 1D array-like
11321132
x-indexes where to plot the lines.
11331133
1134-
ymin, ymax : scalar or 1D array_like
1134+
ymin, ymax : scalar or 1D array-like
11351135
Respective beginning and end of each line. If scalars are
11361136
provided, all lines will have same length.
11371137
1138-
colors : array_like of colors, optional, default: 'k'
1138+
colors : array-like of colors, optional, default: 'k'
11391139
11401140
linestyles : {'solid', 'dashed', 'dashdot', 'dotted'}, optional
11411141
@@ -1803,7 +1803,7 @@ def semilogx(self, *args, **kwargs):
18031803
basex : scalar, optional, default 10
18041804
Base of the x logarithm.
18051805
1806-
subsx : array_like, optional
1806+
subsx : array-like, optional
18071807
The location of the minor xticks. If *None*, reasonable locations
18081808
are automatically chosen depending on the number of decades in the
18091809
plot. See `.Axes.set_xscale` for details.
@@ -1852,7 +1852,7 @@ def semilogy(self, *args, **kwargs):
18521852
basey : scalar, optional, default 10
18531853
Base of the y logarithm.
18541854
1855-
subsy : array_like, optional
1855+
subsy : array-like, optional
18561856
The location of the minor yticks. If *None*, reasonable locations
18571857
are automatically chosen depending on the number of decades in the
18581858
plot. See `.Axes.set_yscale` for details.
@@ -2061,11 +2061,11 @@ def step(self, x, y, *args, where='pre', data=None, **kwargs):
20612061
20622062
Parameters
20632063
----------
2064-
x : array_like
2064+
x : array-like
20652065
1-D sequence of x positions. It is assumed, but not checked, that
20662066
it is uniformly increasing.
20672067
2068-
y : array_like
2068+
y : array-like
20692069
1-D sequence of y levels.
20702070
20712071
fmt : str, optional
@@ -4290,10 +4290,10 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
42904290
42914291
Parameters
42924292
----------
4293-
x, y : scalar or array_like, shape (n, )
4293+
x, y : scalar or array-like, shape (n, )
42944294
The data positions.
42954295
4296-
s : scalar or array_like, shape (n, ), optional
4296+
s : scalar or array-like, shape (n, ), optional
42974297
The marker size in points**2.
42984298
Default is ``rcParams['lines.markersize'] ** 2``.
42994299
@@ -4345,7 +4345,7 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
43454345
alpha : scalar, optional, default: None
43464346
The alpha blending value, between 0 (transparent) and 1 (opaque).
43474347
4348-
linewidths : scalar or array_like, optional, default: None
4348+
linewidths : scalar or array-like, optional, default: None
43494349
The linewidth of the marker edges. Note: The default *edgecolors*
43504350
is 'face'. You may want to change this as well.
43514351
If *None*, defaults to :rc:`lines.linewidth`.
@@ -5707,10 +5707,10 @@ def pcolor(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
57075707
57085708
Parameters
57095709
----------
5710-
C : array_like
5710+
C : array-like
57115711
A scalar 2-D array. The values will be color-mapped.
57125712
5713-
X, Y : array_like, optional
5713+
X, Y : array-like, optional
57145714
The coordinates of the quadrilateral corners. The quadrilateral
57155715
for ``C[i, j]`` has corners at::
57165716
@@ -5938,10 +5938,10 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
59385938
59395939
Parameters
59405940
----------
5941-
C : array_like
5941+
C : array-like
59425942
A scalar 2-D array. The values will be color-mapped.
59435943
5944-
X, Y : array_like, optional
5944+
X, Y : array-like, optional
59455945
The coordinates of the quadrilateral corners. The quadrilateral
59465946
for ``C[i, j]`` has corners at::
59475947
@@ -6405,7 +6405,7 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
64056405
64066406
Default is ``False``.
64076407
6408-
weights : (n, ) array_like or None, optional
6408+
weights : (n, ) array-like or None, optional
64096409
An array of weights, of the same shape as *x*. Each value in *x*
64106410
only contributes its associated weight towards the bin count
64116411
(instead of 1). If *normed* or *density* is ``True``,
@@ -6438,7 +6438,7 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
64386438
64396439
Default is ``False``
64406440
6441-
bottom : array_like, scalar, or None
6441+
bottom : array-like, scalar, or None
64426442
Location of the bottom baseline of each bin. If a scalar,
64436443
the base line for each bin is shifted by the same amount.
64446444
If an array, each bin is shifted independently and the length
@@ -6487,7 +6487,7 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
64876487
64886488
Default is ``False``
64896489
6490-
color : color or array_like of colors or None, optional
6490+
color : color or array-like of colors or None, optional
64916491
Color or sequence of colors, one per dataset. Default (``None``)
64926492
uses the standard line color sequence.
64936493
@@ -6850,25 +6850,25 @@ def hist2d(self, x, y, bins=10, range=None, density=False, weights=None,
68506850
68516851
Parameters
68526852
----------
6853-
x, y : array_like, shape (n, )
6853+
x, y : array-like, shape (n, )
68546854
Input values
68556855
6856-
bins : None or int or [int, int] or array_like or [array, array]
6856+
bins : None or int or [int, int] or array-like or [array, array]
68576857
68586858
The bin specification:
68596859
68606860
- If int, the number of bins for the two dimensions
68616861
(nx=ny=bins).
68626862
- If ``[int, int]``, the number of bins in each dimension
68636863
(nx, ny = bins).
6864-
- If array_like, the bin edges for the two dimensions
6864+
- If array-like, the bin edges for the two dimensions
68656865
(x_edges=y_edges=bins).
68666866
- If ``[array, array]``, the bin edges in each dimension
68676867
(x_edges, y_edges = bins).
68686868
68696869
The default value is 10.
68706870
6871-
range : array_like shape(2, 2), optional, default: None
6871+
range : array-like shape(2, 2), optional, default: None
68726872
The leftmost and rightmost edges of the bins along each dimension
68736873
(if not specified explicitly in the bins parameters): ``[[xmin,
68746874
xmax], [ymin, ymax]]``. All values outside of this range will be
@@ -6878,7 +6878,7 @@ def hist2d(self, x, y, bins=10, range=None, density=False, weights=None,
68786878
Normalize histogram. *normed* is a deprecated synonym for this
68796879
parameter.
68806880
6881-
weights : array_like, shape (n, ), optional, default: None
6881+
weights : array-like, shape (n, ), optional, default: None
68826882
An array of values w_i weighing each sample (x_i, y_i).
68836883
68846884
cmin : scalar, optional, default: None

lib/matplotlib/backend_bases.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,10 @@ def draw_gouraud_triangle(self, gc, points, colors, transform):
269269
270270
Parameters
271271
----------
272-
points : array_like, shape=(3, 2)
272+
points : array-like, shape=(3, 2)
273273
Array of (x, y) points for the triangle.
274274
275-
colors : array_like, shape=(3, 4)
275+
colors : array-like, shape=(3, 4)
276276
RGBA colors for each point of the triangle.
277277
278278
transform : `matplotlib.transforms.Transform`
@@ -288,10 +288,10 @@ def draw_gouraud_triangles(self, gc, triangles_array, colors_array,
288288
289289
Parameters
290290
----------
291-
points : array_like, shape=(N, 3, 2)
291+
points : array-like, shape=(N, 3, 2)
292292
Array of *N* (x, y) points for the triangles.
293293
294-
colors : array_like, shape=(N, 3, 4)
294+
colors : array-like, shape=(N, 3, 4)
295295
Array of *N* RGBA colors for each point of the triangles.
296296
297297
transform : `matplotlib.transforms.Transform`
@@ -471,7 +471,7 @@ def draw_image(self, gc, x, y, im, transform=None):
471471
the distance in physical units (i.e., dots or pixels) from the
472472
bottom side of the canvas.
473473
474-
im : array_like, shape=(N, M, 4), dtype=np.uint8
474+
im : array-like, shape=(N, M, 4), dtype=np.uint8
475475
An array of RGBA pixels.
476476
477477
transform : `matplotlib.transforms.Affine2DBase`
@@ -668,7 +668,7 @@ def points_to_pixels(self, points):
668668
669669
Parameters
670670
----------
671-
points : scalar or array_like
671+
points : scalar or array-like
672672
a float or a numpy array of float
673673
674674
Returns
@@ -899,7 +899,7 @@ def set_dashes(self, dash_offset, dash_list):
899899
----------
900900
dash_offset : float or None
901901
The offset (usually 0).
902-
dash_list : array_like or None
902+
dash_list : array-like or None
903903
The on-off sequence as points.
904904
905905
Notes

lib/matplotlib/markers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def __init__(self, marker=None, fillstyle=None):
231231
232232
Parameters
233233
----------
234-
marker : string or array_like, optional, default: None
234+
marker : string or array-like, optional, default: None
235235
See the descriptions of possible markers in the module docstring.
236236
237237
fillstyle : string, optional, default: 'full'

lib/matplotlib/mlab.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ def specgram(x, NFFT=None, Fs=None, detrend=None, window=None,
981981
982982
Parameters
983983
----------
984-
x : array_like
984+
x : array-like
985985
1-D array or sequence.
986986
987987
%(Spectral)s
@@ -1010,13 +1010,13 @@ def specgram(x, NFFT=None, Fs=None, detrend=None, window=None,
10101010
10111011
Returns
10121012
-------
1013-
spectrum : array_like
1013+
spectrum : array-like
10141014
2-D array, columns are the periodograms of successive segments.
10151015
1016-
freqs : array_like
1016+
freqs : array-like
10171017
1-D array, frequencies corresponding to the rows in *spectrum*.
10181018
1019-
t : array_like
1019+
t : array-like
10201020
1-D array, the times corresponding to midpoints of segments
10211021
(i.e the columns in *spectrum*).
10221022
@@ -1392,7 +1392,7 @@ class GaussianKDE:
13921392
13931393
Parameters
13941394
----------
1395-
dataset : array_like
1395+
dataset : array-like
13961396
Datapoints to estimate from. In case of univariate data this is a 1-D
13971397
array, otherwise a 2-D array with shape (# of dims, # of data).
13981398

lib/matplotlib/path.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,15 @@ def __init__(self, vertices, codes=None, _interpolation_steps=1,
100100
101101
Parameters
102102
----------
103-
vertices : array_like
104-
The ``(n, 2)`` float array, masked array or sequence of pairs
103+
vertices : array-like
104+
The ``(N, 2)`` float array, masked array or sequence of pairs
105105
representing the vertices of the path.
106106
107107
If *vertices* contains masked values, they will be converted
108108
to NaNs which are then handled correctly by the Agg
109109
PathIterator and other consumers of path data, such as
110110
:meth:`iter_segments`.
111-
codes : {None, array_like}, optional
111+
codes : array-like or None, optional
112112
n-length array integers representing the codes of the path.
113113
If not None, codes must be the same length as vertices.
114114
If None, *vertices* will be treated as a series of line segments.

lib/matplotlib/pyplot.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,11 +1443,11 @@ def xticks(ticks=None, labels=None, **kwargs):
14431443
14441444
Parameters
14451445
----------
1446-
ticks : array_like
1446+
ticks : array-like
14471447
A list of positions at which ticks should be placed. You can pass an
14481448
empty list to disable xticks.
14491449
1450-
labels : array_like, optional
1450+
labels : array-like, optional
14511451
A list of explicit labels to place at the given *locs*.
14521452
14531453
**kwargs
@@ -1518,11 +1518,11 @@ def yticks(ticks=None, labels=None, **kwargs):
15181518
15191519
Parameters
15201520
----------
1521-
ticks : array_like
1521+
ticks : array-like
15221522
A list of positions at which ticks should be placed. You can pass an
15231523
empty list to disable yticks.
15241524
1525-
labels : array_like, optional
1525+
labels : array-like, optional
15261526
A list of explicit labels to place at the given *locs*.
15271527
15281528
**kwargs

lib/matplotlib/tests/test_triangulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,7 @@ def test_internal_cpp_api():
11011101

11021102
with pytest.raises(ValueError) as excinfo:
11031103
trifinder.find_many([0], [0, 1])
1104-
excinfo.match(r'x and y must be array_like with same shape')
1104+
excinfo.match(r'x and y must be array-like with same shape')
11051105

11061106

11071107
def test_qhull_large_offset():

lib/matplotlib/tri/triangulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Triangulation:
1111
----------
1212
x, y : array-like of shape (npoints)
1313
Coordinates of grid points.
14-
triangles : integer array_like of shape (ntri, 3), optional
14+
triangles : integer array-like of shape (ntri, 3), optional
1515
For each triangle, the indices of the three points that make
1616
up the triangle, ordered in an anticlockwise manner. If not
1717
specified, the Delaunay triangulation is calculated.

lib/matplotlib/tri/trifinder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class TriFinder:
1313
usually better to use the function
1414
:func:`matplotlib.tri.Triangulation.get_trifinder`.
1515
16-
Derived classes implement __call__(x, y) where x and y are array_like point
16+
Derived classes implement __call__(x, y) where x and y are array-like point
1717
coordinates of the same shape.
1818
"""
1919
def __init__(self, triangulation):
@@ -46,7 +46,7 @@ def __call__(self, x, y):
4646
specified *x*, *y* points lie, or -1 for points that do not lie within
4747
a triangle.
4848
49-
*x*, *y* are array_like x and y coordinates of the same shape and any
49+
*x*, *y* are array-like x and y coordinates of the same shape and any
5050
number of dimensions.
5151
5252
Returns integer array with the same shape and *x* and *y*.

0 commit comments

Comments
 (0)