@@ -531,6 +531,8 @@ def update_ticks(self):
531
531
# get the locator and formatter. Defaults to
532
532
# self.locator if not None..
533
533
locator , formatter = self ._get_ticker_locator_formatter ()
534
+ self .locator = locator
535
+ self .formatter = formatter
534
536
if self .orientation == 'vertical' :
535
537
long_axis , short_axis = ax .yaxis , ax .xaxis
536
538
else :
@@ -1140,11 +1142,16 @@ def update_normal(self, mappable):
1140
1142
Update solid patches, lines, etc.
1141
1143
1142
1144
Unlike `.update_bruteforce`, this does not clear the axes. This is
1143
- meant to be called when the image or contour plot to which this
1144
- colorbar belongs changes.
1145
+ meant to be called when the norm of the image or contour plot to which
1146
+ this colorbar belongs changes.
1147
+
1148
+ This resets the locator and formatter for the axis, so if these
1149
+ have been customized, they will need to be customized again.
1145
1150
"""
1146
1151
1147
1152
self .norm = self .mappable .norm
1153
+ self .locator = None
1154
+ self .formatter = None
1148
1155
self .draw_all ()
1149
1156
if isinstance (self .mappable , contour .ContourSet ):
1150
1157
CS = self .mappable
@@ -1166,6 +1173,10 @@ def update_bruteforce(self, mappable):
1166
1173
# properties have been changed by methods other than the
1167
1174
# colorbar methods, those changes will be lost.
1168
1175
self .ax .cla ()
1176
+ self .locator = None
1177
+ self .formatter = None
1178
+ self .mappable = mappable
1179
+
1169
1180
# clearing the axes will delete outline, patch, solids, and lines:
1170
1181
self .outline = None
1171
1182
self .patch = None
0 commit comments