@@ -1212,16 +1212,20 @@ def update_normal(self, mappable):
1212
1212
meant to be called when the norm of the image or contour plot to which
1213
1213
this colorbar belongs changes.
1214
1214
1215
- This resets the locator and formatter for the axis, so if these
1216
- have been customized, they will need to be customized again.
1215
+ If the norm on the mappable is different than before, this resets the
1216
+ locator and formatter for the axis, so if these have been customized,
1217
+ they will need to be customized again. However, if the norm only
1218
+ changes values of *vmin*, *vmax* or *cmap* then the old formatter
1219
+ and locator will be preserved.
1217
1220
"""
1218
1221
1219
- _log .debug ('colorbar update normal' )
1222
+ _log .debug ('colorbar update normal %r %r' , mappable . norm , self . norm )
1220
1223
self .mappable = mappable
1221
1224
self .set_alpha (mappable .get_alpha ())
1222
1225
self .cmap = mappable .cmap
1223
- self .norm = mappable .norm
1224
- self ._reset_locator_formatter_scale ()
1226
+ if mappable .norm != self .norm :
1227
+ self .norm = mappable .norm
1228
+ self ._reset_locator_formatter_scale ()
1225
1229
1226
1230
self .draw_all ()
1227
1231
if isinstance (self .mappable , contour .ContourSet ):
0 commit comments