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

Skip to content

Commit 1709db8

Browse files
authored
Merge pull request #16999 from timhoffm/doc-imshow-artifacts
Add section on artifacts to imshow docs
2 parents fc8a2fa + a32fb6a commit 1709db8

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
@@ -5326,10 +5326,18 @@ def imshow(self, X, cmap=None, norm=None, aspect=None,
53265326
Display data as an image; i.e. on a 2D regular raster.
53275327
53285328
The input may either be actual RGB(A) data, or 2D scalar data, which
5329-
will be rendered as a pseudocolor image. Note: For actually displaying
5330-
a grayscale image set up the color mapping using the parameters
5329+
will be rendered as a pseudocolor image. For displaying a grayscale
5330+
image set up the color mapping using the parameters
53315331
``cmap='gray', vmin=0, vmax=255``.
53325332
5333+
The number of pixels used to render an image is set by the axes size
5334+
and the *dpi* of the figure. This can lead to aliasing artifacts when
5335+
the image is resampled because the displayed image size will usually
5336+
not match the size of *X* (see
5337+
:doc:`/gallery/images_contours_and_fields/image_antialiasing`).
5338+
The resampling can be controlled via the *interpolation* parameter
5339+
and/or :rc:`image.interpolation`.
5340+
53335341
Parameters
53345342
----------
53355343
X : array-like or PIL image
@@ -5459,7 +5467,7 @@ def imshow(self, X, cmap=None, norm=None, aspect=None,
54595467
The filter radius for filters that have a radius parameter, i.e.
54605468
when interpolation is one of: 'sinc', 'lanczos' or 'blackman'.
54615469
5462-
resample : bool, optional
5470+
resample : bool, default: :rc:`image.resample`
54635471
When *True*, use a full resampling method. When *False*, only
54645472
resample when the output image is larger than the input image.
54655473

0 commit comments

Comments
 (0)