@@ -240,7 +240,8 @@ def tick_values(self, vmin, vmax):
240
240
vmin = max (vmin , self ._colorbar .norm .vmin )
241
241
vmax = min (vmax , self ._colorbar .norm .vmax )
242
242
ticks = super ().tick_values (vmin , vmax )
243
- return ticks [(ticks >= vmin ) & (ticks <= vmax )]
243
+ rtol = (vmax - vmin ) * 1e-10
244
+ return ticks [(ticks >= vmin - rtol ) & (ticks <= vmax + rtol )]
244
245
245
246
246
247
class _ColorbarAutoMinorLocator (ticker .AutoMinorLocator ):
@@ -296,7 +297,10 @@ def tick_values(self, vmin, vmax):
296
297
vmin = self ._colorbar .norm .vmin
297
298
vmax = self ._colorbar .norm .vmax
298
299
ticks = super ().tick_values (vmin , vmax )
299
- return ticks [(ticks >= vmin ) & (ticks <= vmax )]
300
+ rtol = (np .log10 (vmax ) - np .log10 (vmin )) * 1e-10
301
+ ticks = ticks [(np .log10 (ticks ) >= np .log10 (vmin ) - rtol ) &
302
+ (np .log10 (ticks ) <= np .log10 (vmax ) + rtol )]
303
+ return ticks
300
304
301
305
302
306
class ColorbarBase (cm .ScalarMappable ):
@@ -405,7 +409,6 @@ def __init__(self, ax, cmap=None,
405
409
else :
406
410
self .formatter = format # Assume it is a Formatter
407
411
# The rest is in a method so we can recalculate when clim changes.
408
- self .config_axis ()
409
412
self .draw_all ()
410
413
411
414
def _extend_lower (self ):
@@ -439,6 +442,7 @@ def draw_all(self):
439
442
# units:
440
443
X , Y = self ._mesh ()
441
444
C = self ._values [:, np .newaxis ]
445
+ self .config_axis ()
442
446
self ._config_axes (X , Y )
443
447
if self .filled :
444
448
self ._add_solids (X , Y , C )
@@ -593,6 +597,7 @@ def _config_axes(self, X, Y):
593
597
ax .set_frame_on (False )
594
598
ax .set_navigate (False )
595
599
xy = self ._outline (X , Y )
600
+ ax .ignore_existing_data_limits = True
596
601
ax .update_datalim (xy )
597
602
ax .set_xlim (* ax .dataLim .intervalx )
598
603
ax .set_ylim (* ax .dataLim .intervaly )
@@ -1150,7 +1155,6 @@ def update_bruteforce(self, mappable):
1150
1155
self .set_alpha (mappable .get_alpha ())
1151
1156
self .cmap = mappable .cmap
1152
1157
self .norm = mappable .norm
1153
- self .config_axis ()
1154
1158
self .draw_all ()
1155
1159
if isinstance (self .mappable , contour .ContourSet ):
1156
1160
CS = self .mappable
0 commit comments