8000 Merge pull request #24861 from oscargus/docfixes · matplotlib/matplotlib@fb356ed · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fb356ed

Browse files
authored
Merge pull request #24861 from oscargus/docfixes
Documentation fixes
2 parents 84e5f02 + 2de8489 commit fb356ed

File tree

11 files changed

+34
-33
lines changed

11 files changed

+34
-33
lines changed

doc/api/transformations.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
BboxTransformFrom, ScaledTranslation, TransformedPath, nonsingular,
1515
interval_contains, interval_contains_open
1616
:show-inheritance:
17-
:special-members:
17+
:special-members: __add__, __sub__

lib/matplotlib/backend_bases.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,10 +473,10 @@ 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
479-
transform : `matplotlib.transforms.Affine2DBase`
479+
transform : `~matplotlib.transforms.Affine2DBase`
480480
If and only if the concrete backend is written such that
481481
`option_scale_image` returns ``True``, an affine transformation
482482
(i.e., an `.Affine2DBase`) *may* be passed to `draw_image`. The

lib/matplotlib/cm.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -426,18 +426,18 @@ def _scale_norm(self, norm, vmin, vmax):
426426

427427
def to_rgba(self, x, alpha=None, bytes=False, norm=True):
428428
"""
429-
Return a normalized rgba array corresponding to *x*.
429+
Return a normalized RGBA array corresponding to *x*.
430430
431431
In the normal case, *x* is a 1D or 2D sequence of scalars, and
432-
the corresponding `~numpy.ndarray` of rgba values will be returned,
432+
the corresponding `~numpy.ndarray` of RGBA values will be returned,
433433
based on the norm and colormap set for this ScalarMappable.
434434
435435
There is one special case, for handling images that are already
436-
rgb or rgba, such as might have been read from an image file.
436+
RGB or RGBA, such as might have been read from an image file.
437437
If *x* is an `~numpy.ndarray` with 3 dimensions,
438438
and the last dimension is either 3 or 4, then it will be
439-
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
439+
treated as an RGB or RGBA array, and no mapping will be done.
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)
@@ -446,9 +446,9 @@ def to_rgba(self, x, alpha=None, bytes=False, norm=True):
446446
replace the preexisting alpha. A ValueError will be raised
447447
if the third dimension is other than 3 or 4.
448448
449-
In either case, if *bytes* is *False* (default), the rgba
449+
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/contour.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def clabel(self, levels=None, *,
107107
- If one string color, e.g., *colors* = 'r' or *colors* =
108108
'red', all labels will be plotted in this color.
109109
110-
- If a tuple of colors (string, float, rgb, etc), different labels
110+
- If a tuple of colors (string, float, RGB, etc), different labels
111111
will be plotted in different colors in the order specified.
112112
113113
inline : bool, default: True

lib/matplotlib/image.py

Lines changed: 10 additions & 9 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,12 +348,12 @@ 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
354355
space.
355-
trans : Affine2D
356+
trans : `~matplotlib.transforms.Affine2D`
356357
The affine transformation from image to pixel space.
357358
"""
358359
if A is None:
@@ -596,12 +597,12 @@ 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
603604
space.
604-
trans : Affine2D
605+
trans : `~matplotlib.transforms.Affine2D`
605606
The affine transformation from image to pixel space.
606607
"""
607608
raise NotImplementedError('The make_image method must be overridden')
@@ -781,7 +782,7 @@ def set_interpolation_stage(self, s):
781782
Parameters
782783
----------
783784
s : {'data', 'rgba'} or None
784-
Whether to apply up/downsampling interpolation in data or rgba
785+
Whether to apply up/downsampling interpolation in data or RGBA
785786
space.
786787
"""
787788
if s is None:

lib/matplotlib/markers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ def transformed(self, transform: Affine2D):
418418
419419
Parameters
420420
----------
421-
transform : Affine2D, default: None
421+
transform : `~matplotlib.transforms.Affine2D`, default: None
422422
Transform will be combined with current user supplied transform.
423423
"""
424424
new_marker = MarkerStyle(self)

lib/matplotlib/path.py

Lines changed: 3 additions & 3 deletions
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
@@ -1051,9 +1051,9 @@ def get_path_collection_extents(
10511051
master_transform : `.Transform`
10521052
Global transformation applied to all paths.
10531053
paths : list of `Path`
1054-
transforms : list of `.Affine2D`
1054+
transforms : list of `~matplotlib.transforms.Affine2DBase`
10551055
offsets : (N, 2) array-like
1056-
offset_transform : `.Affine2D`
1056+
offset_transform : `~matplotlib.transforms.Affine2DBase`
10571057
Transform applied to the offsets before offsetting the path.
10581058
10591059
Notes

lib/matplotlib/texmanager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ def get_grey(cls, tex, fontsize=None, dpi=None):
346346
@classmethod
347347
def get_rgba(cls, tex, fontsize=None, dpi=None, rgb=(0, 0, 0)):
348348
r"""
349-
Return latex's rendering of the tex string as an rgba array.
349+
Return latex's rendering of the tex string as an RGBA array.
350350
351351
Examples
352352
--------

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2676,12 +2676,12 @@ def voxels(self, *args, facecolors=None, edgecolors=None, shade=True,
26762676
These parameters can be:
26772677
26782678
- A single color value, to color all voxels the same color. This
2679-
can be either a string, or a 1D rgb/rgba array
2679+
can be either a string, or a 1D RGB/RGBA array
26802680
- ``None``, the default, to use a single color for the faces, and
26812681
the style default for the edges.
26822682
- A 3D `~numpy.ndarray` of color names, with each item the color
26832683
for the corresponding voxel. The size must match the voxels.
2684-
- A 4D `~numpy.ndarray` of rgb/rgba data, with the components
2684+
- A 4D `~numpy.ndarray` of RGB/RGBA data, with the components
26852685
along the last axis.
26862686
26872687
shade : bool, default: True

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)
0