@@ -893,24 +893,25 @@ def _process_values(self, b=None):
893
893
if b is not None :
894
894
self ._boundaries = np .asarray (b , dtype = float )
895
895
if self .values is None and self .boundaries is not None :
896
- # define the outside indices
896
+ # define the outside additions
897
897
if self .extend == 'min' :
898
- i = 0
898
+ to_add = self . _boundaries [ 0 ]
899
899
elif self .extend == 'max' :
900
- i = - 1
900
+ to_add = self . _boundaries [ - 1 ]
901
901
elif self .extend == 'both' :
902
- i = [ 0 , - 1 ]
902
+ to_add = self . _boundaries [[ 0 , - 1 ] ]
903
903
elif self .extend == 'neither' :
904
- i = slice ( None )
904
+ to_add = []
905
905
# add values to the colorbar insides
906
906
boundaries_inside = self ._boundaries [self ._inside ]
907
+ n_between = max ((self .cmap .N - len (to_add ))// \
908
+ (len (boundaries_inside )- 1 ), 1 )
907
909
self ._values = np .linspace (boundaries_inside [:- 1 ],
908
910
np .roll (boundaries_inside , - 1 )[:- 1 ],
909
- 1000 , endpoint = False ,
910
- axis = - 1 ).flatten ()
911
+ n_between , endpoint = False ,
912
+ axis = - 1 ).flatten ()
911
913
self ._values = np .append (self ._values , boundaries_inside [- 1 ])
912
914
# add back in the boundaries for the extensions
913
- to_add = np .atleast_1d (self ._boundaries [i ])
914
915
self ._boundaries = np .sort (np .concatenate ([to_add ,
915
916
self ._values ]))
916
917
# calculate values at which to plot colors
0 commit comments