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

Skip to content

Commit 0596444

Browse files
committed
undo SciNotation as default
1 parent 6155c1a commit 0596444

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

lib/matplotlib/scale.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from matplotlib.cbook import dedent
1010
from matplotlib.ticker import (NullFormatter, ScalarFormatter,
11-
LogFormatterSciNotation, LogitFormatter)
11+
LogFormatterMathtext, LogitFormatter)
1212
from matplotlib.ticker import (NullLocator, LogLocator, AutoLocator,
1313
SymmetricalLogLocator, LogitLocator)
1414
from matplotlib.transforms import Transform, IdentityTransform
@@ -304,9 +304,9 @@ def set_default_locators_and_formatters(self, axis):
304304
log scaling.
305305
"""
306306
axis.set_major_locator(LogLocator(self.base))
307-
axis.set_major_formatter(LogFormatterSciNotation(self.base))
307+
axis.set_major_formatter(LogFormatterMathtext(self.base))
308308
axis.set_minor_locator(LogLocator(self.base, self.subs))
309-
axis.set_minor_formatter(LogFormatterSciNotation(self.base))
309+
axis.set_minor_formatter(NullFormatter())
310310

311311
def get_transform(self):
312312
"""
@@ -462,10 +462,10 @@ def set_default_locators_and_formatters(self, axis):
462462
symmetrical log scaling.
463463
"""
464464
axis.set_major_locator(SymmetricalLogLocator(self.get_transform()))
465-
axis.set_major_formatter(LogFormatterSciNotation(self.base))
465+
axis.set_major_formatter(LogFormatterMathtext(self.base))
466466
axis.set_minor_locator(SymmetricalLogLocator(self.get_transform(),
467467
self.subs))
468-
axis.set_minor_formatter(LogFormatterSciNotation(self.base))
468+
axis.set_minor_formatter(NullFormatter())
469469

470470
def get_transform(self):
471471
"""

lib/matplotlib/ticker.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -953,11 +953,11 @@ class LogFormatterMathtext(LogFormatter):
953953

954954
def _non_decade_format(self, sign_string, base, fx, usetex):
955955
'Return string for non-decade locations'
956-
if usetex:
957-
return (r'$%s%s^{%.2f}$') % (sign_string, base, fx)
958-
else:
959-
return ('$%s$' % _mathdefault('%s%s^{%.2f}' %
960-
(sign_string, base, fx)))
956+
if usetex:
957+
return (r'$%s%s^{%.2f}$') % (sign_string, base, fx)
958+
else:
959+
return ('$%s$' % _mathdefault('%s%s^{%.2f}' %
960+
(sign_string, base, fx)))
961961

962962
def __call__(self, x, pos=None):
963963
"""
@@ -1021,8 +1021,8 @@ def _non_decade_format(self, sign_string, base, fx, usetex):
10211021
return (r'$%g\times%s^{%d}$') % \
10221022
(coeff, base, exponent)
10231023
else:
1024-
return (r'$\mathdefault{%g\times%s^{%d}}$') % \
1025-
(coeff, base, exponent)
1024+
return ('$%s$' % _mathdefault(r'%g\times%s^{%d}' %
1025+
(coeff, base, exponent)))
10261026

10271027

10281028
class LogitFormatter(Formatter):

0 commit comments

Comments
 (0)