8000 FIX: make minor ticks formatted with science formatter as well · matplotlib/matplotlib@eb5c4b2 · GitHub
[go: up one dir, main page]

Skip to content

Commit eb5c4b2

Browse files
committed
FIX: make minor ticks formatted with science formatter as well
1 parent 49480ee commit eb5c4b2

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

lib/matplotlib/colorbar.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,12 @@ def __init__(self, colorbar):
234234
self._colorbar = colorbar
235235
nbins = 'auto'
236236
steps = [1, 2, 2.5, 5, 10]
237-
ticker.MaxNLocator.__init__(self, nbins=nbins, steps=steps)
237+
super().__init__(nbins=nbins, steps=steps)
238238

239239
def tick_values(self, vmin, vmax):
240240
vmin = max(vmin, self._colorbar.norm.vmin)
241241
vmax = min(vmax, self._colorbar.norm.vmax)
242-
ticks = ticker.MaxNLocator.tick_values(self, vmin, vmax)
242+
ticks = super().tick_values(vmin, vmax)
243243
return ticks[(ticks >= vmin) & (ticks <= vmax)]
244244

245245

@@ -260,12 +260,12 @@ def __init__(self, colorbar, n=None):
260260
"""
261261
self._colorbar = colorbar
262262
self.ndivs = n
263-
ticker.AutoMinorLocator.__init__(self, n=None)
263+
super().__init__(n=None)
264264

265265
def __call__(self):
266266
vmin = self._colorbar.norm.vmin
267267
vmax = self._colorbar.norm.vmax
268-
ticks = ticker.AutoMinorLocator.__call__(self)
268+
ticks = super().__call__()
269269
rtol = (vmax - vmin) * 1e-10
270270
return ticks[(ticks >= vmin - rtol) & (ticks <= vmax + rtol)]
271271

@@ -290,12 +290,12 @@ def __init__(self, colorbar, *args, **kwargs):
290290
same as `~.ticker.LogLocator`.
291291
"""
292292
self._colorbar = colorbar
293-
ticker.LogLocator.__init__(self, *args, **kwargs)
293+
super().__init__(*args, **kwargs)
294294

295295
def tick_values(self, vmin, vmax):
296296
vmin = self._colorbar.norm.vmin
297297
vmax = self._colorbar.norm.vmax
298-
ticks = ticker.LogLocator.tick_values(self, vmin, vmax)
298+
ticks = super().tick_values(vmin, vmax)
299299
return ticks[(ticks >= vmin) & (ticks <= vmax)]
300300

301301

@@ -461,7 +461,6 @@ def config_axis(self):
461461
long_axis.set_ticks_position(self.ticklocation)
462462
short_axis.set_ticks([])
463463
short_axis.set_ticks([], minor=True)
464-
465464
self._set_label()
466465

467466
def _get_ticker_locator_formatter(self):
@@ -536,7 +535,7 @@ def update_ticks(self):
536535
long_axis.set_minor_locator(_ColorbarLogLocator(self,
537536
base=10., subs='auto'))
538537
long_axis.set_minor_formatter(
539-
ticker.LogFormatter()
538+
ticker.LogFormatterSciNotation()
540539
)
541540
else:
542541
_log.debug('Using fixed locator on colorbar')

0 commit comments

Comments
 (0)
0