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

Skip to content

Documentation fixes #24861

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/api/transformations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
BboxTransformFrom, ScaledTranslation, TransformedPath, nonsingular,
interval_contains, interval_contains_open
:show-inheritance:
:special-members:
:special-members: __add__, __sub__
4 changes: 2 additions & 2 deletions lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,10 +473,10 @@ def draw_image(self, gc, x, y, im, transform=None):
The distance in physical units (i.e., dots or pixels) from the
bottom side of the canvas.

im : (N, M, 4) array-like of np.uint8
im : (N, M, 4) array of `numpy.uint8`
An array of RGBA pixels.

transform : `matplotlib.transforms.Affine2DBase`
transform : `~matplotlib.transforms.Affine2DBase`
If and only if the concrete backend is written such that
`option_scale_image` returns ``True``, an affine transformation
(i.e., an `.Affine2DBase`) *may* be passed to `draw_image`. The
Expand Down
14 changes: 7 additions & 7 deletions lib/matplotlib/cm.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,18 +426,18 @@ def _scale_norm(self, norm, vmin, vmax):

def to_rgba(self, x, alpha=None, bytes=False, norm=True):
"""
Return a normalized rgba array corresponding to *x*.
Return a normalized RGBA array corresponding to *x*.

In the normal case, *x* is a 1D or 2D sequence of scalars, and
the corresponding `~numpy.ndarray` of rgba values will be returned,
the corresponding `~numpy.ndarray` of RGBA values will be returned,
based on the norm and colormap set for this ScalarMappable.

There is one special case, for handling images that are already
rgb or rgba, such as might have been read from an image file.
RGB or RGBA, such as might have been read from an image file.
If *x* is an `~numpy.ndarray` with 3 dimensions,
and the last dimension is either 3 or 4, then it will be
treated as an rgb or rgba array, and no mapping will be done.
The array can be uint8, or it can be floating point with
treated as an RGB or RGBA array, and no mapping will be done.
The array can be `~numpy.uint8`, or it can be floats with
values in the 0-1 range; otherwise a ValueError will be raised.
If it is a masked array, the mask will be ignored.
If the last dimension is 3, the *alpha* kwarg (defaulting to 1)
Expand All @@ -446,9 +446,9 @@ def to_rgba(self, x, alpha=None, bytes=False, norm=True):
replace the preexisting alpha. A ValueError will be raised
if the third dimension is other than 3 or 4.

In either case, if *bytes* is *False* (default), the rgba
In either case, if *bytes* is *False* (default), the RGBA
array will be floats in the 0-1 range; if it is *True*,
the returned rgba array will be uint8 in the 0 to 255 range.
the returned RGBA array will be `~numpy.uint8` in the 0 to 255 range.

If norm is False, no normalization of the input data is
performed, and it is assumed to be in the range (0-1).
Expand Down
6 changes: 3 additions & 3 deletions lib/matplotlib/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ def __init__(self, name, N=256):
self.colorbar_extend = False

def __call__(self, X, alpha=None, bytes=False):
"""
r"""
Parameters
----------
X : float or int, `~numpy.ndarray` or scalar
Expand All @@ -695,8 +695,8 @@ def __call__(self, X, alpha=None, bytes=False):
floats with shape matching X, or None.
bytes : bool
If False (default), the returned RGBA values will be floats in the
interval ``[0, 1]`` otherwise they will be uint8s in the interval
``[0, 255]``.
interval ``[0, 1]`` otherwise they will be `numpy.uint8`\s in the
interval ``[0, 255]``.

Returns
-------
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/contour.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def clabel(self, levels=None, *,
- If one string color, e.g., *colors* = 'r' or *colors* =
'red', all labels will be plotted in this color.

- If a tuple of colors (string, float, rgb, etc), different labels
- If a tuple of colors (string, float, RGB, etc), different labels
will be plotted in different colors in the order specified.

inline : bool, default: True
Expand Down
19 changes: 10 additions & 9 deletions lib/matplotlib/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def composite_images(images, renderer, magnification=1.0):

Returns
-------
image : uint8 array (M, N, 4)
image : (M, N, 4) `numpy.uint8` array
The composited RGBA image.
offset_x, offset_y : float
The (left, bottom) offset where the composited image should be placed
Expand Down Expand Up @@ -333,9 +333,10 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,
the given *clip_bbox* (also in pixel space), and magnified by the
*magnification* factor.

*A* may be a greyscale image (M, N) with a dtype of float32, float64,
float128, uint16 or uint8, or an (M, N, 4) RGBA image with a dtype of
float32, float64, float128, or uint8.
*A* may be a greyscale image (M, N) with a dtype of `~numpy.float32`,
`~numpy.float64`, `~numpy.float128`, `~numpy.uint16` or `~numpy.uint8`,
or an (M, N, 4) RGBA image with a dtype of `~numpy.float32`,
`~numpy.float64`, `~numpy.float128`, or `~numpy.uint8`.

If *unsampled* is True, the image will not be scaled, but an
appropriate affine transformation will be returned instead.
Expand All @@ -347,12 +348,12 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,

Returns
-------
image : (M, N, 4) uint8 array
image : (M, N, 4) `numpy.uint8` array
The RGBA image, resampled unless *unsampled* is True.
x, y : float
The upper left corner where the image should be drawn, in pixel
space.
trans : Affine2D
trans : `~matplotlib.transforms.Affine2D`
The affine transformation from image to pixel space.
"""
if A is None:
Expand Down Expand Up @@ -596,12 +597,12 @@ def make_image(self, renderer, magnification=1.0, unsampled=False):

Returns
-------
image : (M, N, 4) uint8 array
image : (M, N, 4) `numpy.uint8` array
The RGBA image, resampled unless *unsampled* is True.
x, y : float
The upper left corner where the image should be drawn, in pixel
space.
trans : Affine2D
trans : `~matplotlib.transforms.Affine2D`
The affine transformation from image to pixel space.
"""
raise NotImplementedError('The make_image method must be overridden')
Expand Down Expand Up @@ -781,7 +782,7 @@ def set_interpolation_stage(self, s):
Parameters
----------
s : {'data', 'rgba'} or None
Whether to apply up/downsampling interpolation in data or rgba
Whether to apply up/downsampling interpolation in data or RGBA
space.
"""
if s is None:
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ def transformed(self, transform: Affine2D):

Parameters
----------
transform : Affine2D, default: None
transform : `~matplotlib.transforms.Affine2D`, default: None
Transform will be combined with current user supplied transform.
"""
new_marker = MarkerStyle(self)
Expand Down
6 changes: 3 additions & 3 deletions lib/matplotlib/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Path:
The underlying storage is made up of two parallel numpy arrays:

- *vertices*: an (N, 2) float array of vertices
- *codes*: an N-length uint8 array of path codes, or None
- *codes*: an N-length `numpy.uint8` array of path codes, or None

These two arrays always have the same length in the first
dimension. For example, to represent a cubic curve, you must
Expand Down Expand Up @@ -1051,9 +1051,9 @@ def get_path_collection_extents(
master_transform : `.Transform`
Global transformation applied to all paths.
paths : list of `Path`
transforms : list of `.Affine2D`
transforms : list of `~matplotlib.transforms.Affine2DBase`
offsets : (N, 2) array-like
offset_transform : `.Affine2D`
offset_transform : `~matplotlib.transforms.Affine2DBase`
Transform applied to the offsets before offsetting the path.

Notes
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/texmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def get_grey(cls, tex, fontsize=None, dpi=None):
@classmethod
def get_rgba(cls, tex, fontsize=None, dpi=None, rgb=(0, 0, 0)):
r"""
Return latex's rendering of the tex string as an rgba array.
Return latex's rendering of the tex string as an RGBA array.

Examples
--------
Expand Down
4 changes: 2 additions & 2 deletions lib/mpl_toolkits/mplot3d/axes3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -2676,12 +2676,12 @@ def voxels(self, *args, facecolors=None, edgecolors=None, shade=True,
These parameters can be:

- A single color value, to color all voxels the same color. This
can be either a string, or a 1D rgb/rgba array
can be either a string, or a 1D RGB/RGBA array
- ``None``, the default, to use a single color for the faces, and
the style default for the edges.
- A 3D `~numpy.ndarray` of color names, with each item the color
for the corresponding voxel. The size must match the voxels.
- A 4D `~numpy.ndarray` of rgb/rgba data, with the components
- A 4D `~numpy.ndarray` of RGB/RGBA data, with the components
along the last axis.

shade : bool, default: True
Expand Down
6 changes: 3 additions & 3 deletions src/_image_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ const char* image_resample__doc__ =

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

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

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