Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a5d6c87

Browse filesBrowse files
committed
undo SciNotation as default
1 parent 0fe88f3 commit a5d6c87
Copy full SHA for a5d6c87

File tree

Expand file treeCollapse file tree

2 files changed

+12
-12
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+12
-12
lines changed

‎lib/matplotlib/scale.py

Copy file name to clipboardExpand all lines: lib/matplotlib/scale.py
+5-5Lines 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

Copy file name to clipboardExpand all lines: lib/matplotlib/ticker.py
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -807,11 +807,11 @@ class LogFormatterMathtext(LogFormatter):
807807

808808
def _non_decade_format(self, sign_string, base, fx, usetex):
809809
'Return string for non-decade locations'
810-
if usetex:
811-
return (r'$%s%s^{%.2f}$') % (sign_string, base, fx)
812-
else:
813-
return ('$%s$' % _mathdefault('%s%s^{%.2f}' %
814-
(sign_string, base, fx)))
810+
if usetex:
811+
return (r'$%s%s^{%.2f}$') % (sign_string, base, fx)
812+
else:
813+
return ('$%s$' % _mathdefault('%s%s^{%.2f}' %
814+
(sign_string, base, fx)))
815815

816816
def __call__(self, x, pos=None):
817817
'Return the format for tick val *x* at position *pos*'
@@ -871,8 +871,8 @@ def _non_decade_format(self, sign_string, base, fx, usetex):
871871
return (r'$%g\times%s^{%d}$') % \
872872
(coeff, base, exponent)
873873
else:
874-
return (r'$\mathdefault{%g\times%s^{%d}}$') % \
875-
(coeff, base, exponent)
874+
return ('$%s$' % _mathdefault(r'%g\times%s^{%d}' %
875+
(coeff, base, exponent)))
876876

877877

878878
class LogitFormatter(Formatter):

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.