8000 Merge pull request #24831 from oscargus/ndarray · matplotlib/matplotlib@aded13a · GitHub
[go: up one dir, main page]

Skip to content

Commit aded13a

Browse files
authored
Merge pull request #24831 from oscargus/ndarray
[Doc] Fix ndarray-links for arguments
2 parents 8b7c3b4 + f16da86 commit aded13a

File tree

10 files changed

+43
-43
lines changed

10 files changed

+43
-43
lines changed

lib/matplotlib/category.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def convert(value, unit, axis):
4343
4444
Returns
4545
-------
46-
float or ndarray[float]
46+
float or `~numpy.ndarray` of float
4747
"""
4848
if unit is None:
4949
raise ValueError(

lib/matplotlib/cm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,12 +437,12 @@ def to_rgba(self, x, alpha=None, bytes=False, norm=True):
437437
Return a normalized rgba array corresponding to *x*.
438438
439439
In the normal case, *x* is a 1D or 2D sequence of scalars, and
440-
the corresponding ndarray of rgba values will be returned,
440+
the corresponding `~numpy.ndarray` of rgba values will be returned,
441441
based on the norm and colormap set for this ScalarMappable.
442442
443443
There is one special case, for handling images that are already
444444
rgb or rgba, such as might have been read from an image file.
445-
If *x* is an ndarray with 3 dimensions,
445+
If *x* is an `~numpy.ndarray` with 3 dimensions,
446446
and the last dimension is either 3 or 4, then it will be
447447
treated as an rgb or rgba array, and no mapping will be done.
448448
The array can be uint8, or it can be floating point with

lib/matplotlib/collections.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ def set_sizes(self, sizes, dpi=72.0):
953953
954954
Parameters
955955
----------
956-
sizes : ndarray or None
956+
sizes : `numpy.ndarray` or None
957957
The size to set for each element of the collection. The
958958
value is the 'area' of the element.
959959
dpi : float, default: 72

lib/matplotlib/colors.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,8 @@ def to_rgba_array(c, alpha=None):
403403
Parameters
404404
----------
405405
c : Matplotlib color or array of colors
406-
If *c* is a masked array, an ndarray is returned with a (0, 0, 0, 0)
407-
row for each masked value or row in *c*.
406+
If *c* is a masked array, an `~numpy.ndarray` is returned with a
407+
(0, 0, 0, 0) row for each masked value or row in *c*.
408408
409409
alpha : float or sequence of floats, optional
410410
If *alpha* is given, force the alpha value of the returned RGBA tuple
@@ -684,11 +684,11 @@ def __call__(self, X, alpha=None, bytes=False):
684684
"""
685685
Parameters
686686
----------
687-
X : float or int, ndarray or scalar
687+
X : float or int, `~numpy.ndarray` or scalar
688688
The data value(s) to convert to RGBA.
689-
For floats, X should be in the interval ``[0.0, 1.0]`` to
689+
For floats, *X* should be in the interval ``[0.0, 1.0]`` to
690690
return the RGBA values ``X*100`` percent along the Colormap line.
691-
For integers, X should be in the interval ``[0, Colormap.N)`` to
691+
For integers, *X* should be in the interval ``[0, Colormap.N)`` to
692692
return RGBA values *indexed* from the Colormap with index ``X``.
693693
alpha : float or array-like or None
694694
Alpha must be a scalar between 0 and 1, a sequence of such
@@ -2061,7 +2061,7 @@ def rgb_to_hsv(arr):
20612061
20622062
Returns
20632063
-------
2064-
(..., 3) ndarray
2064+
(..., 3) `~numpy.ndarray`
20652065
Colors converted to HSV values in range [0, 1]
20662066
"""
20672067
arr = np.asarray(arr)
@@ -2112,7 +2112,7 @@ def hsv_to_rgb(hsv):
21122112
21132113
Returns
21142114
-------
2115-
(..., 3) ndarray
2115+
(..., 3) `~numpy.ndarray`
21162116
Colors converted to RGB values in range [0, 1]
21172117
"""
21182118
hsv = np.asarray(hsv)
@@ -2279,7 +2279,7 @@ def hillshade(self, elevation, vert_exag=1, dx=1, dy=1, fraction=1.):
22792279
22802280
Returns
22812281
-------
2282-
ndarray
2282+
`~numpy.ndarray`
22832283
A 2D array of illumination values between 0-1, where 0 is
22842284
completely in shadow and 1 is completely illuminated.
22852285
"""
@@ -2322,7 +2322,7 @@ def shade_normals(self, normals, fraction=1.):
23222322
23232323
Returns
23242324
-------
2325-
ndarray
2325+
`~numpy.ndarray`
23262326
A 2D array of illumination values between 0-1, where 0 is
23272327
completely in shadow and 1 is completely illuminated.
23282328
"""
@@ -2404,7 +2404,7 @@ def shade(self, data, cmap, norm=None, blend_mode='overlay', vmin=None,
24042404
24052405
Returns
24062406
-------
2407-
ndarray
2407+
`~numpy.ndarray`
24082408
An MxNx4 array of floats ranging between 0-1.
24092409
"""
24102410
if vmin is None:
@@ -2465,7 +2465,7 @@ def shade_rgb(self, rgb, elevation, fraction=1., blend_mode='hsv',
24652465
24662466
Returns
24672467
-------
2468-
ndarray
2468+
`~numpy.ndarray`
24692469
An (m, n, 3) array of floats ranging between 0-1.
24702470
"""
24712471
# Calculate the "hillshade" intensity.
@@ -2512,9 +2512,9 @@ def blend_hsv(self, rgb, intensity, hsv_max_sat=None, hsv_max_val=None,
25122512
25132513
Parameters
25142514
----------
2515-
rgb : ndarray
2515+
rgb : `~numpy.ndarray`
25162516
An MxNx3 RGB array of floats ranging from 0 to 1 (color image).
2517-
intensity : ndarray
2517+
intensity : `~numpy.ndarray`
25182518
An MxNx1 array of floats ranging from 0 to 1 (grayscale image).
25192519
hsv_max_sat : number, default: 1
25202520
The maximum saturation value that the *intensity* map can shift the
@@ -2531,7 +2531,7 @@ def blend_hsv(self, rgb, intensity, hsv_max_sat=None, hsv_max_val=None,
25312531
25322532
Returns
25332533
-------
2534-
ndarray
2534+
`~numpy.ndarray`
25352535
An MxNx3 RGB array representing the combined images.
25362536
"""
25372537
# Backward compatibility...
@@ -2574,14 +2574,14 @@ def blend_soft_light(self, rgb, intensity):
25742574
25752575
Parameters
25762576
----------
2577-
rgb : ndarray
2577+
rgb : `~numpy.ndarray`
25782578
An MxNx3 RGB array of floats ranging from 0 to 1 (color image).
2579-
intensity : ndarray
2579+
intensity : `~numpy.ndarray`
25802580
An MxNx1 array of floats ranging from 0 to 1 (grayscale image).
25812581
25822582
Returns
25832583
-------
2584-
ndarray
2584+
`~numpy.ndarray`
25852585
An MxNx3 RGB array representing the combined images.
25862586
"""
25872587
return 2 * intensity * rgb + (1 - 2 * intensity) * rgb**2
@@ -2592,9 +2592,9 @@ def blend_overlay(self, rgb, intensity):
25922592
25932593
Parameters
25942594
----------
2595-
rgb : ndarray
2595+
rgb : `~numpy.ndarray`
25962596
An MxNx3 RGB array of floats ranging from 0 to 1 (color image).
2597-
intensity : ndarray
2597+
intensity : `~numpy.ndarray`
25982598
An MxNx1 array of floats ranging from 0 to 1 (grayscale image).
25992599
26002600
Returns

lib/matplotlib/dates.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,10 +320,10 @@ def get_epoch():
320320

321321
def _dt64_to_ordinalf(d):
322322
"""
323-
Convert `numpy.datetime64` or an ndarray of those types to Gregorian
324-
date as UTC float relative to the epoch (see `.get_epoch`). Roundoff
325-
is float64 precision. Practically: microseconds for dates between
326-
290301 BC, 294241 AD, milliseconds for larger dates
323+
Convert `numpy.datetime64` or an `numpy.ndarray` of those types to
324+
Gregorian date as UTC float relative to the epoch (see `.get_epoch`).
325+
Roundoff is float64 precision. Practically: microseconds for dates
326+
between 290301 BC, 294241 AD, milliseconds for larger dates
327327
(see `numpy.datetime64`).
328328
"""
329329

lib/matplotlib/figure.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,7 +1339,7 @@ def align_xlabels(self, axs=None):
13391339
Parameters
13401340
----------
13411341
axs : list of `~matplotlib.axes.Axes`
1342-
Optional list of (or ndarray) `~matplotlib.axes.Axes`
1342+
Optional list of (or `~numpy.ndarray`) `~matplotlib.axes.Axes`
13431343
to align the xlabels.
13441344
Default is to align all Axes on the figure.
13451345
@@ -1400,7 +1400,7 @@ def align_ylabels(self, axs=None):
14001400
Parameters
14011401
----------
14021402
axs : list of `~matplotlib.axes.Axes`
1403-
Optional list (or ndarray) of `~matplotlib.axes.Axes`
1403+
Optional list (or `~numpy.ndarray`) of `~matplotlib.axes.Axes`
14041404
to align the ylabels.
14051405
Default is to align all Axes on the figure.
14061406
@@ -1455,7 +1455,7 @@ def align_labels(self, axs=None):
14551455
Parameters
14561456
----------
14571457
axs : list of `~matplotlib.axes.Axes`
1458-
Optional list (or ndarray) of `~matplotlib.axes.Axes`
1458+
Optional list (or `~numpy.ndarray`) of `~matplotlib.axes.Axes`
14591459
to align the labels.
14601460
Default is to align all Axes on the figure.
14611461

lib/matplotlib/image.py

Lines changed: 4 additions & 4 deletions
Original file line nu 2851 mberDiff line numberDiff line change
@@ -1143,8 +1143,8 @@ def set_data(self, x, y, A):
11431143
Monotonic arrays of shapes (N,) and (M,), respectively, specifying
11441144
pixel centers.
11451145
A : array-like
1146-
(M, N) ndarray or masked array of values to be colormapped, or
1147-
(M, N, 3) RGB array, or (M, N, 4) RGBA array.
1146+
(M, N) `~numpy.ndarray` or masked array of values to be
1147+
colormapped, or (M, N, 3) RGB array, or (M, N, 4) RGBA array.
11481148
"""
11491149
x = np.array(x, np.float32)
11501150
y = np.array(y, np.float32)
@@ -1232,7 +1232,7 @@ def __init__(self, ax,
12321232
The data to be color-coded. The interpretation depends on the
12331233
shape:
12341234
1235-
- (M, N) ndarray or masked array: values to be colormapped
1235+
- (M, N) `~numpy.ndarray` or masked array: values to be colormapped
12361236
- (M, N, 3): RGB array
12371237
- (M, N, 4): RGBA array
12381238
@@ -1298,7 +1298,7 @@ def set_data(self, x, y, A):
12981298
The data to be color-coded. The interpretation depends on the
12991299
shape:
13001300
1301-
- (M, N) ndarray or masked array: values to be colormapped
1301+
- (M, N) `~numpy.ndarray` or masked array: values to be colormapped
13021302
- (M, N, 3): RGB array
13031303
- (M, N, 4): RGBA array
13041304
"""

lib/matplotlib/quiver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ def _find_tails(self, mag, rounding=True, half=5, full=10, flag=50):
946946
947947
Parameters
948948
----------
949-
mag : array
949+
mag : `~numpy.ndarray`
950950
Vector magnitudes; must be non-negative (and an actual ndarray).
951951
rounding : bool, default: True
952952
Whether to round or to truncate to the nearest half-barb.

lib/matplotlib/transforms.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ def __init__(self, points, **kwargs):
755755
"""
756756
Parameters
757757
----------
758-
points : ndarray
758+
points : `~numpy.ndarray`
759759
A 2x2 numpy array of the form ``[[x0, y0], [x1, y1]]``.
760760
"""
761761
super().__init__(**kwargs)
@@ -897,7 +897,7 @@ def update_from_data_x(self, x, ignore=None):
897897
898898
Parameters
899899
----------
900-
x : ndarray
900+
x : `~numpy.ndarray`
901901
Array of x-values.
902902
903903
ignore : bool, optional
@@ -917,7 +917,7 @@ def update_from_data_y(self, y, ignore=None):
917917
918918
Parameters
919919
----------
920-
y : ndarray
920+
y : `~numpy.ndarray`
921921
Array of y-values.
922922
923923
ignore : bool, optional
@@ -937,7 +937,7 @@ def update_from_data_xy(self, xy, ignore=None, updatex=True, updatey=True):
937937
938938
Parameters
939939
----------
940-
xy : ndarray
940+
xy : `~numpy.ndarray`
941941
A numpy array of 2D points.
942942
943943
ignore : bool, optional

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2698,10 +2698,10 @@ def voxels(self, *args, facecolors=None, edgecolors=None, shade=True,
26982698
can be either a string, or a 1D rgb/rgba array
26992699
- ``None``, the default, to use a single color for the faces, and
27002700
the style default for the edges.
2701-
- A 3D ndarray of color names, with each item the color for the
2702-
corresponding voxel. The size must match the voxels.
2703-
- A 4D ndarray of rgb/rgba data, with the components along the
2704-
last axis.
2701+
- A 3D `~numpy.ndarray` of color names, with each item the color
2702+
for the corresponding voxel. The size must match the voxels.
2703+
- A 4D `~numpy.ndarray` of rgb/rgba data, with the components
2704+
along the last axis.
27052705
27062706
shade : bool, default: True
27072707
Whether to shade the facecolors.

0 commit comments

Comments
 (0)
0