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

Skip to content

Commit a32fb6a

Browse files
timhoffmjklymakstory645
committed
Add section on artifacts to imshow docs
Co-authored-by: Jody Klymak <[email protected]> Co-authored-by: hannah <[email protected]>
1 parent 17ef13b commit a32fb6a

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5300,10 +5300,18 @@ def imshow(self, X, cmap=None, norm=None, aspect=None,
53005300
Display data as an image; i.e. on a 2D regular raster.
53015301
53025302
The input may either be actual RGB(A) data, or 2D scalar data, which
5303-
will be rendered as a pseudocolor image. Note: For actually displaying
5304-
a grayscale image set up the color mapping using the parameters
5303+
will be rendered as a pseudocolor image. For displaying a grayscale
5304+
image set up the color mapping using the parameters
53055305
``cmap='gray', vmin=0, vmax=255``.
53065306
5307+
The number of pixels used to render an image is set by the axes size
5308+
and the *dpi* of the figure. This can lead to aliasing artifacts when
5309+
the image is resampled because the displayed image size will usually
5310+
not match the size of *X* (see
5311+
:doc:`/gallery/images_contours_and_fields/image_antialiasing`).
5312+
The resampling can be controlled via the *interpolation* parameter
5313+
and/or :rc:`image.interpolation`.
5314+
53075315
Parameters
53085316
----------
53095317
X : array-like or PIL image
@@ -5433,7 +5441,7 @@ def imshow(self, X, cmap=None, norm=None, aspect=None,
54335441
The filter radius for filters that have a radius parameter, i.e.
54345442
when interpolation is one of: 'sinc', 'lanczos' or 'blackman'.
54355443
5436-
resample : bool, optional
5444+
resample : bool, default: :rc:`image.resample`
54375445
When *True*, use a full resampling method. When *False*, only
54385446
resample when the output image is larger than the input image.
54395447

0 commit comments

Comments
 (0)