Skip to content

Commit 0da0818

Browse files
committed
ENH: anti-alias down-sampled images
1 parent 5553dac commit 0da0818

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/image.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ def set_antialiased(self, antialiased):
249249
any user supplied filters are ignored, and a Lanczos filter is
250250
applied with radius `2 * M_data / M_image`.
251251
"""
252+
self._antialiased = antialiased
252253

253254
def set_alpha(self, alpha):
254255
"""
@@ -442,7 +443,7 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,
442443
dtype=A_scaled.dtype)
443444
if self.get_antialiased() and A.shape[0] > out_height:
444445
self.set_interpolation('lanczos')
445-
self.set_filterrad(2.0 * A.shape[0] / out_height )
446+
self.set_filterrad(3.0 * A.shape[0] / out_height )
446447

447448
# resample the input data to the correct resolution and shape
448449
_image.resample(A_scaled, A_resampled,

0 commit comments

Comments
 (0)