Skip to content

Minor tweaks to image docs. #29184

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 1 commit into from
Nov 25, 2024
Merged
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
33 changes: 17 additions & 16 deletions lib/matplotlib/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,17 +234,18 @@ class _ImageBase(mcolorizer.ColorizingArtist):
"""
Base class for images.

interpolation and cmap default to their rc settings
*interpolation* and *cmap* default to their rc settings.

cmap is a colors.Colormap instance
norm is a colors.Normalize instance to map luminance to 0-1
*cmap* is a `.colors.Colormap` instance.
*norm* is a `.colors.Normalize` instance to map luminance to 0-1.

extent is data axes (left, right, bottom, top) for making image plots
registered with data plots. Default is to label the pixel
centers with the zero-based row and column indices.
*extent* is a ``(left, right, bottom, top)`` tuple in data coordinates, for
making image plots registered with data plots; the default is to label the
pixel centers with the zero-based row and column indices.

Additional kwargs are matplotlib.artist properties
Additional kwargs are `.Artist` properties.
"""
Comment on lines +237 to 247
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an improvement, so ok. But actually, this should be a formal "Parameters" section.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know, but I didn't really want to go through rewriting the whole thing, so I'll self-merge.


zorder = 0

def __init__(self, ax,
Expand Down Expand Up @@ -733,11 +734,10 @@ def set_interpolation_stage(self, s):

Parameters
----------
s : {'data', 'rgba', 'auto'} or None
Whether to apply up/downsampling interpolation in data or RGBA
space. If None, use :rc:`image.interpolation_stage`.
If 'auto' we will check upsampling rate and if less
than 3 then use 'rgba', otherwise use 'data'.
s : {'data', 'rgba', 'auto'}, default: :rc:`image.interpolation_stage`
Whether to apply resampling interpolation in data or RGBA space.
If 'auto', 'rgba' is used if the upsampling rate is less than 3,
otherwise 'data' is used.
"""
s = mpl._val_or_rc(s, 'image.interpolation_stage')
_api.check_in_list(['data', 'rgba', 'auto'], s=s)
Expand All @@ -758,8 +758,7 @@ def set_resample(self, v):

Parameters
----------
v : bool or None
If None, use :rc:`image.resample`.
v : bool, default: :rc:`image.resample`
"""
v = mpl._val_or_rc(v, 'image.resample')
self._resample = v
Expand Down Expand Up @@ -788,8 +787,10 @@ def get_filternorm(self):

def set_filterrad(self, filterrad):
"""
Set the resize filter radius only applicable to some
interpolation schemes -- see help for imshow
Set the resize filter radius (only applicable to some
interpolation schemes).

See help for `~.Axes.imshow`.

Parameters
----------
Expand Down
Loading