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

Skip to content

Commit 87b62ea

Browse files
committed
Link to numpy.uint8
1 parent b5de523 commit 87b62ea

File tree

6 files changed

+17
-16
lines changed

6 files changed

+17
-16
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ def draw_image(self, gc, x, y, im, transform=None):
473473
The distance in physical units (i.e., dots or pixels) from the
474474
bottom side of the canvas.
475475
476-
im : (N, M, 4) array-like of np.uint8
476+
im : (N, M, 4) array of `numpy.uint8`
477477
An array of RGBA pixels.
478478
479479
transform : `matplotlib.transforms.Affine2DBase`

lib/matplotlib/cm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ def to_rgba(self, x, alpha=None, bytes=False, norm=True):
437437
If *x* is an `~numpy.ndarray` with 3 dimensions,
438438
and the last dimension is either 3 or 4, then it will be
439439
treated as an RGB or RGBA array, and no mapping will be done.
440-
The array can be uint8, or it can be floating point with
440+
The array can be `~numpy.uint8`, or it can be floats with
441441
values in the 0-1 range; otherwise a ValueError will be raised.
442442
If it is a masked array, the mask will be ignored.
443443
If the last dimension is 3, the *alpha* kwarg (defaulting to 1)
@@ -448,7 +448,7 @@ def to_rgba(self, x, alpha=None, bytes=False, norm=True):
448448
449449
In either case, if *bytes* is *False* (default), the RGBA
450450
array will be floats in the 0-1 range; if it is *True*,
451-
the returned RGBA array will be uint8 in the 0 to 255 range.
451+
the returned RGBA array will be `~numpy.uint8` in the 0 to 255 range.
452452
453453
If norm is False, no normalization of the input data is
454454
performed, and it is assumed to be in the range (0-1).

lib/matplotlib/colors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ def __init__(self, name, N=256):
681681
self.colorbar_extend = False
682682

683683
def __call__(self, X, alpha=None, bytes=False):
684-
"""
684+
r"""
685685
Parameters
686686
----------
687687
X : float or int, `~numpy.ndarray` or scalar
@@ -695,8 +695,8 @@ def __call__(self, X, alpha=None, bytes=False):
695695
floats with shape matching X, or None.
696696
bytes : bool
697697
If False (default), the returned RGBA values will be floats in the
698-
interval ``[0, 1]`` otherwise they will be uint8s in the interval
699-
``[0, 255]``.
698+
interval ``[0, 1]`` otherwise they will be `numpy.uint8`\s in the
699+
interval ``[0, 255]``.
700700
701701
Returns
702702
-------

lib/matplotlib/image.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def composite_images(images, renderer, magnification=1.0):
7474
7575
Returns
7676
-------
77-
image : uint8 array (M, N, 4)
77+
image : (M, N, 4) `numpy.uint8` array
7878
The composited RGBA image.
7979
offset_x, offset_y : float
8080
The (left, bottom) offset where the composited image should be placed
@@ -333,9 +333,10 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,
333333
the given *clip_bbox* (also in pixel space), and magnified by the
334334
*magnification* factor.
335335
336-
*A* may be a greyscale image (M, N) with a dtype of float32, float64,
337-
float128, uint16 or uint8, or an (M, N, 4) RGBA image with a dtype of
338-
float32, float64, float128, or uint8.
336+
*A* may be a greyscale image (M, N) with a dtype of `~numpy.float32`,
337+
`~numpy.float64`, `~numpy.float128`, `~numpy.uint16` or `~numpy.uint8`,
338+
or an (M, N, 4) RGBA image with a dtype of `~numpy.float32`,
339+
`~numpy.float64`, `~numpy.float128`, or `~numpy.uint8`.
339340
340341
If *unsampled* is True, the image will not be scaled, but an
341342
appropriate affine transformation will be returned instead.
@@ -347,7 +348,7 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,
347348
348349
Returns
349350
-------
350-
image : (M, N, 4) uint8 array
351+
image : (M, N, 4) `numpy.uint8` array
351352
The RGBA image, resampled unless *unsampled* is True.
352353
x, y : float
353354
The upper left corner where the image should be drawn, in pixel
@@ -596,7 +597,7 @@ def make_image(self, renderer, magnification=1.0, unsampled=False):
596597
597598
Returns
598599
-------
599-
image : (M, N, 4) uint8 array
600+
image : (M, N, 4) `numpy.uint8` array
600601
The RGBA image, resampled unless *unsampled* is True.
601602
x, y : float
602603
The upper left corner where the image should be drawn, in pixel

lib/matplotlib/path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Path:
2929
The underlying storage is made up of two parallel numpy arrays:
3030
3131
- *vertices*: an (N, 2) float array of vertices
32-
- *codes*: an N-length uint8 array of path codes, or None
32+
- *codes*: an N-length `numpy.uint8` array of path codes, or None
3333
3434
These two arrays always have the same length in the first
3535
dimension. For example, to represent a cubic curve, you must

src/_image_wrapper.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ const char* image_resample__doc__ =
1717

1818
"Parameters\n"
1919
"----------\n"
20-
"input_array : 2-d or 3-d array-like of float, double or uint8\n"
20+
"input_array : 2-d or 3-d NumPy array of float, double or `numpy.uint8`\n"
2121
" If 2-d, the image is grayscale. If 3-d, the image must be of size\n"
2222
" 4 in the last dimension and represents RGBA data.\n\n"
2323

24-
"output_array : 2-d or 3-d numpy array of float, double or uint8\n"
25-
" The dtype and number of dimensions must match *input_array*.\n\n"
24+
"output_array : 2-d or 3-d NumPy array of float, double or `numpy.uint8`\n"
25+
" The dtype and number of dimensions must match `input_array`.\n\n"
2626

2727
"transform : matplotlib.transforms.Transform instance\n"
2828
" The transformation from the input array to the output array.\n\n"

0 commit comments

Comments
 (0)