Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6d3b883

Browse files
committed
fix LogFormatter and make Colorbar to use LogFormatterMathtext
1 parent cb609d5 commit 6d3b883

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/matplotlib/colorbar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def __init__(self, ax, cmap=None,
234234
self.locator = ticks # Handle default in _ticker()
235235
if format is None:
236236
if isinstance(self.norm, colors.LogNorm):
237-
self.formatter = ticker.LogFormatter()
237+
self.formatter = ticker.LogFormatterMathtext()
238238
else:
239239
self.formatter = ticker.ScalarFormatter()
240240
elif cbook.is_string_like(format):

lib/matplotlib/ticker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ def __call__(self, x, pos=None):
546546
sign = np.sign(x)
547547
# only label the decades
548548
fx = math.log(abs(x))/math.log(b)
549-
isDecade = is_decade(fx)
549+
isDecade = is_close_to_int(fx)
550550
if not isDecade and self.labelOnlyBase: s = ''
551551
elif x>10000: s= '%1.0e'%x
552552
elif x<1: s = '%1.0e'%x

0 commit comments

Comments
 (0)