Skip to content

Commit a2a3db2

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

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/matplotlib/image.py

Lines changed: 5 additions & 4 deletions
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)