3131
3232# map interpolation strings to module constants
3333_interpd_ = {
34- 'antialiased ' : _image .NEAREST , # this will use nearest or Hanning...
34+ 'auto ' : _image .NEAREST , # this will use nearest or Hanning...
3535 'none' : _image .NEAREST , # fall back to nearest when not supported
3636 'nearest' : _image .NEAREST ,
3737 'bilinear' : _image .BILINEAR ,
5050 'sinc' : _image .SINC ,
5151 'lanczos' : _image .LANCZOS ,
5252 'blackman' : _image .BLACKMAN ,
53+ 'antialiased' : _image .NEAREST , # this will use nearest or Hanning...
5354}
5455
5556interpolations_names = set (_interpd_ )
@@ -186,7 +187,7 @@ def _resample(
186187 # compare the number of displayed pixels to the number of
187188 # the data pixels.
188189 interpolation = image_obj .get_interpolation ()
189- if interpolation == 'antialiased' :
190+ if interpolation in [ 'antialiased' , 'auto' ] :
190191 # don't antialias if upsampling by an integer number or
191192 # if zooming in more than a factor of 3
192193 pos = np .array ([[0 , 0 ], [data .shape [1 ], data .shape [0 ]]])
@@ -425,7 +426,7 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,
425426 # if antialiased, this needs to change as window sizes
426427 # change:
427428 interpolation_stage = self ._interpolation_stage
428- if interpolation_stage == 'antialiased' :
429+ if interpolation_stage in [ 'antialiased' , 'auto' ] :
429430 pos = np .array ([[0 , 0 ], [A .shape [1 ], A .shape [0 ]]])
430431 disp = t .transform (pos )
431432 dispx = np .abs (np .diff (disp [:, 0 ])) / A .shape [1 ]
@@ -758,9 +759,9 @@ def get_interpolation(self):
758759 """
759760 Return the interpolation method the image uses when resizing.
760761
761- One of 'antialiased ', 'nearest ', 'bilinear ', 'bicubic ', 'spline16 ',
762- 'spline36', 'hanning', 'hamming', 'hermite', 'kaiser', 'quadric ',
763- 'catrom', 'gaussian', 'bessel', 'mitchell', 'sinc', 'lanczos',
762+ One of 'auto ', 'antialiased ', 'nearest ', 'bilinear ', 'bicubic ',
763+ 'spline16', ' spline36', 'hanning', 'hamming', 'hermite', 'kaiser',
764+ 'quadric', ' catrom', 'gaussian', 'bessel', 'mitchell', 'sinc', 'lanczos',
764765 or 'none'.
765766 """
766767 return self ._interpolation
@@ -776,7 +777,7 @@ def set_interpolation(self, s):
776777
777778 Parameters
778779 ----------
779- s : {'antialiased ', 'nearest', 'bilinear', 'bicubic', 'spline16', \
780+ s : {'auto ', 'nearest', 'bilinear', 'bicubic', 'spline16', \
780781 'spline36', 'hanning', 'hamming', 'hermite', 'kaiser', 'quadric', 'catrom', \
781782 'gaussian', 'bessel', 'mitchell', 'sinc', 'lanczos', 'none'} or None
782783 """
@@ -799,14 +800,14 @@ def set_interpolation_stage(self, s):
799800
800801 Parameters
801802 ----------
802- s : {'data', 'rgba', 'antialiased '} or None
803+ s : {'data', 'rgba', 'auto '} or None
803804 Whether to apply up/downsampling interpolation in data or RGBA
804805 space. If None, use :rc:`image.interpolation_stage`.
805- If 'antialiased ' we will check upsampling rate and if less
806+ If 'auto ' we will check upsampling rate and if less
806807 than 3 then use 'rgba', otherwise use 'data'.
807808 """
808809 s = mpl ._val_or_rc (s , 'image.interpolation_stage' )
809- _api .check_in_list (['data' , 'rgba' , 'antialiased ' ], s = s )
810+ _api .check_in_list (['data' , 'rgba' , 'auto ' ], s = s )
810811 self ._interpolation_stage = s
811812 self .stale = True
812813
@@ -886,7 +887,7 @@ class AxesImage(_ImageBase):
886887 norm : str or `~matplotlib.colors.Normalize`
887888 Maps luminance to 0-1.
888889 interpolation : str, default: :rc:`image.interpolation`
889- Supported values are 'none', 'antialiased ', 'nearest', 'bilinear',
890+ Supported values are 'none', 'auto ', 'nearest', 'bilinear',
890891 'bicubic', 'spline16', 'spline36', 'hanning', 'hamming', 'hermite',
891892 'kaiser', 'quadric', 'catrom', 'gaussian', 'bessel', 'mitchell',
892893 'sinc', 'lanczos', 'blackman'.
0 commit comments