@@ -1106,18 +1106,14 @@ def _mesh(self):
1106
1106
norm = copy .deepcopy (self .norm )
1107
1107
norm .vmin = self .vmin
1108
1108
norm .vmax = self .vmax
1109
- x = np .array ([0.0 , 1.0 ])
1110
1109
y , extendlen = self ._proportional_y ()
1111
1110
# invert:
1112
- if (isinstance (norm , (colors .BoundaryNorm , colors .NoNorm )) or
1113
- (self .__scale == 'manual' )):
1114
- # if a norm doesn't have a named scale, or we are not using a norm:
1115
- dv = self .vmax - self .vmin
1116
- y = y * dv + self .vmin
1111
+ if isinstance (norm , (colors .BoundaryNorm , colors .NoNorm )):
1112
+ y = y * (self .vmax - self .vmin ) + self .vmin # not using a norm.
1117
1113
else :
1118
1114
y = norm .inverse (y )
1119
1115
self ._y = y
1120
- X , Y = np .meshgrid (x , y )
1116
+ X , Y = np .meshgrid ([ 0. , 1. ] , y )
1121
1117
if self .orientation == 'vertical' :
1122
1118
return (X , Y , extendlen )
1123
1119
else :
@@ -1152,8 +1148,8 @@ def _reset_locator_formatter_scale(self):
1152
1148
self ._set_scale ('function' , functions = funcs )
1153
1149
elif self .spacing == 'proportional' :
1154
1150
self ._set_scale ('linear' )
1155
- elif hasattr (self .norm , '_scale' ) and self . norm . _scale is not None :
1156
- # use the norm's scale:
1151
+ elif getattr (self .norm , '_scale' , None ) :
1152
+ # use the norm's scale (if it exists and is not None) :
1157
1153
self ._set_scale (self .norm ._scale )
1158
1154
elif type (self .norm ) is colors .Normalize :
1159
1155
# plain Normalize:
0 commit comments