From 8427c29abe28acafc9a26ea12cd1e08790389eeb Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Thu, 30 Mar 2023 23:27:48 -0400 Subject: [PATCH] Backport PR #25585: DOC: improve interpolation kwarg doc in imshow [ci doc] --- lib/matplotlib/axes/_axes.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 410d1c5e3966..0628510dcc1e 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -5531,11 +5531,15 @@ def imshow(self, X, cmap=None, norm=None, *, aspect=None, 'kaiser', 'quadric', 'catrom', 'gaussian', 'bessel', 'mitchell', 'sinc', 'lanczos', 'blackman'. - If *interpolation* is 'none', then no interpolation is performed - on the Agg, ps, pdf and svg backends. Other backends will fall back - to 'nearest'. Note that most SVG renderers perform interpolation at - rendering and that the default interpolation method they implement - may differ. + The data *X* is resampled to the pixel size of the image on the + figure canvas, using the interpolation method to either up- or + downsample the data. + + If *interpolation* is 'none', then for the ps, pdf, and svg + backends no down- or upsampling occurs, and the image data is + passed to the backend as a native image. Note that different ps, + pdf, and svg viewers may display these raw pixels differently. On + other backends, 'none' is the same as 'nearest'. If *interpolation* is the default 'antialiased', then 'nearest' interpolation is used if the image is upsampled by more than a