@@ -206,7 +206,7 @@ def __init__(self, ax,
206
206
norm = None ,
207
207
interpolation = None ,
208
208
origin = None ,
209
- filternorm = 1 ,
209
+ filternorm = True ,
210
210
filterrad = 4.0 ,
211
211
resample = False ,
212
212
** kwargs
@@ -412,8 +412,8 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,
412
412
t ,
413
413
_interpd_ [self .get_interpolation ()],
414
414
self .get_resample (), 1.0 ,
415
- self .get_filternorm () or 0.0 ,
416
- self .get_filterrad () or 0.0 )
415
+ self .get_filternorm (),
416
+ self .get_filterrad ())
417
417
418
418
# we are done with A_scaled now, remove from namespace
419
419
# to be sure!
@@ -447,8 +447,8 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,
447
447
t ,
448
448
_interpd_ [self .get_interpolation ()],
449
449
True , 1 ,
450
- self .get_filternorm () or 0.0 ,
451
- self .get_filterrad () or 0.0 )
450
+ self .get_filternorm (),
451
+ self .get_filterrad ())
452
452
# we are done with the mask, delete from namespace to be sure!
453
453
del mask
454
454
# Agg updates the out_mask in place. If the pixel has
@@ -481,7 +481,7 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,
481
481
_image .resample (
482
482
A , output , t , _interpd_ [self .get_interpolation ()],
483
483
self .get_resample (), alpha ,
484
- self .get_filternorm () or 0.0 , self .get_filterrad () or 0.0 )
484
+ self .get_filternorm (), self .get_filterrad ())
485
485
486
486
# at this point output is either a 2D array of normed data
487
487
# (of int or float)
@@ -720,20 +720,17 @@ def get_resample(self):
720
720
721
721
def set_filternorm (self , filternorm ):
722
722
"""
723
- Set whether the resize filter norms the weights -- see
724
- help for imshow
723
+ Set whether the resize filter normalizes the weights.
725
724
726
- ACCEPTS: 0 or 1
727
- """
728
- if filternorm :
729
- self ._filternorm = 1
730
- else :
731
- self ._filternorm = 0
725
+ See help for `~.Axes.imshow`.
732
726
727
+ .. ACCEPTS: bool
728
+ """
729
+ self ._filternorm = bool (filternorm )
733
730
self .stale = True
734
731
735
732
def get_filternorm (self ):
736
- """Return the filternorm setting ."""
733
+ """Return whether the resize filter normalizes the weights ."""
737
734
return self ._filternorm
738
735
739
736
def set_filterrad (self , filterrad ):
0 commit comments