@@ -1101,6 +1101,8 @@ def _process_values(self):
1101
1101
elif isinstance (self .norm , colors .NoNorm ):
1102
1102
# NoNorm has N blocks, so N+1 boundaries, centered on integers:
1103
1103
b = np .arange (self .cmap .N + 1 ) - .5
1104
+ elif self .boundaries is not None :
1105
+ b = self .boundaries
1104
1106
else :
1105
1107
# otherwise make the boundaries from the size of the cmap:
1106
1108
N = self .cmap .N + 1
@@ -1117,7 +1119,8 @@ def _process_values(self):
1117
1119
self .norm .vmax = 1
1118
1120
self .norm .vmin , self .norm .vmax = mtransforms .nonsingular (
1119
1121
self .norm .vmin , self .norm .vmax , expander = 0.1 )
1120
- if not isinstance (self .norm , colors .BoundaryNorm ):
1122
+ if (not isinstance (self .norm , colors .BoundaryNorm ) and
1123
+ (self .boundaries is None )):
1121
1124
b = self .norm .inverse (b )
1122
1125
1123
1126
self ._boundaries = np .asarray (b , dtype = float )
@@ -1141,7 +1144,8 @@ def _mesh(self):
1141
1144
norm .vmax = self .vmax
1142
1145
y , extendlen = self ._proportional_y ()
1143
1146
# invert:
1144
- if isinstance (norm , (colors .BoundaryNorm , colors .NoNorm )):
1147
+ if (isinstance (norm , (colors .BoundaryNorm , colors .NoNorm )) or
1148
+ self .boundaries is not None ):
1145
1149
y = y * (self .vmax - self .vmin ) + self .vmin # not using a norm.
1146
1150
else :
1147
1151
y = norm .inverse (y )
@@ -1237,7 +1241,8 @@ def _proportional_y(self):
1237
1241
Return colorbar data coordinates for the boundaries of
1238
1242
a proportional colorbar, plus extension lengths if required:
1239
1243
"""
1240
- if isinstance (self .norm , colors .BoundaryNorm ):
1244
+ if (isinstance (self .norm , colors .BoundaryNorm ) or
1245
+ self .boundaries is not None ):
1241
1246
y = (self ._boundaries - self ._boundaries [self ._inside ][0 ])
1242
1247
y = y / (self ._boundaries [self ._inside ][- 1 ] -
1243
1248
self ._boundaries [self ._inside ][0 ])
0 commit comments