Skip to content

Commit af9b9a7

Browse files
committed
ENH: use hanning instead of lanczos
1 parent 0da0818 commit af9b9a7

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

lib/matplotlib/axes/_axes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5436,7 +5436,7 @@ def imshow(self, X, cmap=None, norm=None, aspect=None,
54365436
interpolation=None, alpha=None, vmin=None, vmax=None,
54375437
origin=None, extent=None, shape=None, filternorm=1,
54385438
filterrad=4.0, imlim=None, resample=None,
5439-
antialiased=True, url=None, **kwargs):
5439+
url=None, antialiased=True, **kwargs):
54405440
"""
54415441
Display an image, i.e. data on a 2D regular raster.
54425442

lib/matplotlib/image.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -441,9 +441,10 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,
441441
A_scaled += 0.1
442442
A_resampled = np.zeros((out_height, out_width),
443443
dtype=A_scaled.dtype)
444-
if self.get_antialiased() and A.shape[0] > out_height:
445-
self.set_interpolation('lanczos')
446-
self.set_filterrad(3.0 * A.shape[0] / out_height )
444+
if (self.get_interpolation() == 'nearest' and
445+
self.get_antialiased() and
446+
A.shape[0] > 0.5 * out_height):
447+
self.set_interpolation('hanning')
447448

448449
# resample the input data to the correct resolution and shape
449450
_image.resample(A_scaled, A_resampled,
@@ -1291,8 +1292,8 @@ def __init__(self, bbox,
12911292
filternorm=1,
12921293
filterrad=4.0,
12931294
resample=False,
1294-
antialiased=True,
12951295
interp_at_native=True,
1296+
antialiased=True,
12961297
**kwargs
12971298
):
12981299
"""

0 commit comments

Comments
 (0)