@@ -1094,6 +1094,8 @@ def _process_values(self):
10941094 elif isinstance (self .norm , colors .NoNorm ):
10951095 # NoNorm has N blocks, so N+1 boundaries, centered on integers:
10961096 b = np .arange (self .cmap .N + 1 ) - .5
1097+ elif self .boundaries is not None :
1098+ b = self .boundaries
10971099 else :
10981100 # otherwise make the boundaries from the size of the cmap:
10991101 N = self .cmap .N + 1
@@ -1110,7 +1112,8 @@ def _process_values(self):
11101112 self .norm .vmax = 1
11111113 self .norm .vmin , self .norm .vmax = mtransforms .nonsingular (
11121114 self .norm .vmin , self .norm .vmax , expander = 0.1 )
1113- if not isinstance (self .norm , colors .BoundaryNorm ):
1115+ if (not isinstance (self .norm , colors .BoundaryNorm ) and
1116+ (self .boundaries is None )):
11141117 b = self .norm .inverse (b )
11151118
11161119 self ._boundaries = np .asarray (b , dtype = float )
@@ -1134,7 +1137,8 @@ def _mesh(self):
11341137 norm .vmax = self .vmax
11351138 y , extendlen = self ._proportional_y ()
11361139 # invert:
1137- if isinstance (norm , (colors .BoundaryNorm , colors .NoNorm )):
1140+ if (isinstance (norm , (colors .BoundaryNorm , colors .NoNorm )) or
1141+ self .boundaries is not None ):
11381142 y = y * (self .vmax - self .vmin ) + self .vmin # not using a norm.
11391143 else :
11401144 y = norm .inverse (y )
@@ -1230,7 +1234,8 @@ def _proportional_y(self):
12301234 Return colorbar data coordinates for the boundaries of
12311235 a proportional colorbar, plus extension lengths if required:
12321236 """
1233- if isinstance (self .norm , colors .BoundaryNorm ):
1237+ if (isinstance (self .norm , colors .BoundaryNorm ) or
1238+ self .boundaries is not None ):
12341239 y = (self ._boundaries - self ._boundaries [self ._inside ][0 ])
12351240 y = y / (self ._boundaries [self ._inside ][- 1 ] -
12361241 self ._boundaries [self ._inside ][0 ])
0 commit comments