@@ -551,8 +551,8 @@ def add_lines(self, levels, colors, linewidths, erase=True):
551
551
552
552
def _ticker (self ):
553
553
'''
554
- Return two sequences: ticks (colorbar data locations)
555
- and ticklabels (strings).
554
+ Return the sequence of ticks (colorbar data locations),
555
+ ticklabels (strings), and the corresponding offset string .
556
556
'''
557
557
locator = self .locator
558
558
formatter = self .formatter
@@ -653,6 +653,9 @@ def _process_values(self, b=None):
653
653
self ._values = v
654
654
return
655
655
else :
656
+ self .norm .vmin , self .norm .vmax = mtrans .nonsingular (self .norm .vmin ,
657
+ self .norm .vmax ,
658
+ expander = 0.1 )
656
659
if not self .norm .scaled ():
657
660
self .norm .vmin = 0
658
661
self .norm .vmax = 1
@@ -817,24 +820,21 @@ def _locate(self, x):
817
820
# as to make the interpolation more accurate.
818
821
b = self .norm (self ._boundaries , clip = False ).filled ()
819
822
xn = self .norm (x , clip = False ).filled ()
823
+
820
824
# The rest is linear interpolation with extrapolation at ends.
821
- y = self ._y
822
- N = len (b )
823
825
ii = np .searchsorted (b , xn )
824
826
i0 = ii - 1
825
- itop = (ii == N )
827
+ itop = (ii == len ( b ) )
826
828
ibot = (ii == 0 )
827
829
i0 [itop ] -= 1
828
830
ii [itop ] -= 1
829
831
i0 [ibot ] += 1
830
832
ii [ibot ] += 1
831
833
832
- #db = b[ii] - b[i0]
833
834
db = np .take (b , ii ) - np .take (b , i0 )
834
- #dy = y[ii] - y[i0]
835
+ y = self . _y
835
836
dy = np .take (y , ii ) - np .take (y , i0 )
836
837
z = np .take (y , i0 ) + (xn - np .take (b , i0 )) * dy / db
837
-
838
838
return z
839
839
840
840
def set_alpha (self , alpha ):
0 commit comments