@@ -996,6 +996,13 @@ def _inverse_boundaries(self, x):
996996 b = self ._boundaries
997997 return np .interp (x , np .linspace (0 , b [- 1 ], len (b )), b )
998998
999+ def _forward_from_norm (self , x ):
1000+ y = self .norm (x )
1001+ return y
1002+
1003+ def _inverse_from_norm (self , x ):
1004+ return self .norm .inverse (x )
1005+
9991006 def _reset_locator_formatter_scale (self ):
10001007 """
10011008 Reset the locator et al to defaults. Any user-hardcoded changes
@@ -1006,24 +1013,30 @@ def _reset_locator_formatter_scale(self):
10061013 self .locator = None
10071014 self .minorlocator = None
10081015 self .formatter = None
1009- if ((self .spacing == 'uniform' ) and
1010- ((self .boundaries is not None ) or
1011- isinstance (self .norm , colors .BoundaryNorm ))):
1012- funcs = (self ._forward_boundaries , self ._inverse_boundaries )
1013- self .ax .set_xscale ('function' , functions = funcs )
1014- self .ax .set_yscale ('function' , functions = funcs )
1015- self .__scale = 'function'
1016+ if (self .boundaries is not None or
1017+ isinstance (self .norm , colors .BoundaryNorm )):
1018+ if self .spacing == 'uniform' :
1019+ funcs = (self ._forward_boundaries , self ._inverse_boundaries )
1020+ self .ax .set_xscale ('function' , functions = funcs )
1021+ self .ax .set_yscale ('function' , functions = funcs )
1022+ self .__scale = 'function'
1023+ elif self .spacing == 'proportional' :
1024+ self .__scale = 'linear'
1025+ self .ax .set_xscale ('linear' )
1026+ self .ax .set_yscale ('linear' )
10161027 elif hasattr (self .norm , '_scale' ) and (self .norm ._scale is not None ):
10171028 self .ax .set_xscale (self .norm ._scale )
10181029 self .ax .set_yscale (self .norm ._scale )
10191030 self .__scale = self .norm ._scale .name
1020- else :
1031+ elif type (self .norm ) is colors .Normalize :
1032+ self .__scale = 'linear'
10211033 self .ax .set_xscale ('linear' )
10221034 self .ax .set_yscale ('linear' )
1023- if type (self .norm ) is colors .Normalize :
1024- self .__scale = 'linear'
1025- else :
1026- self .__scale = 'manual'
1035+ else :
1036+ funcs = (self ._forward_from_norm , self ._inverse_from_norm )
1037+ self .ax .set_xscale ('function' , functions = funcs )
1038+ self .ax .set_yscale ('function' , functions = funcs )
1039+ self .__scale = 'function'
10271040
10281041 def _locate (self , x ):
10291042 """
0 commit comments