diff --git a/lib/matplotlib/tests/test_ticker.py b/lib/matplotlib/tests/test_ticker.py index 30f3caead0bb..3a8a4a321c8c 100644 --- a/lib/matplotlib/tests/test_ticker.py +++ b/lib/matplotlib/tests/test_ticker.py @@ -321,24 +321,24 @@ def get_view_interval(self): def test_LogFormatterSciNotation(): test_cases = { 10: ( - (-1, '${-10^{0}}$'), - (1e-05, '${10^{-5}}$'), - (1, '${10^{0}}$'), - (100000, '${10^{5}}$'), - (2e-05, '${2\\times10^{-5}}$'), - (2, '${2\\times10^{0}}$'), - (200000, '${2\\times10^{5}}$'), - (5e-05, '${5\\times10^{-5}}$'), - (5, '${5\\times10^{0}}$'), - (500000, '${5\\times10^{5}}$'), + (-1, '$\\mathdefault{-10^{0}}$'), + (1e-05, '$\\mathdefault{10^{-5}}$'), + (1, '$\\mathdefault{10^{0}}$'), + (100000, '$\\mathdefault{10^{5}}$'), + (2e-05, '$\\mathdefault{2\\times10^{-5}}$'), + (2, '$\\mathdefault{2\\times10^{0}}$'), + (200000, '$\\mathdefault{2\\times10^{5}}$'), + (5e-05, '$\\mathdefault{5\\times10^{-5}}$'), + (5, '$\\mathdefault{5\\times10^{0}}$'), + (500000, '$\\mathdefault{5\\times10^{5}}$'), ), 2: ( - (0.03125, '${2^{-5}}$'), - (1, '${2^{0}}$'), - (32, '${2^{5}}$'), - (0.0375, '${1.2\\times2^{-5}}$'), - (1.2, '${1.2\\times2^{0}}$'), - (38.4, '${1.2\\times2^{5}}$'), + (0.03125, '$\\mathdefault{2^{-5}}$'), + (1, '$\\mathdefault{2^{0}}$'), + (32, '$\\mathdefault{2^{5}}$'), + (0.0375, '$\\mathdefault{1.2\\times2^{-5}}$'), + (1.2, '$\\mathdefault{1.2\\times2^{0}}$'), + (38.4, '$\\mathdefault{1.2\\times2^{5}}$'), ) } diff --git a/lib/matplotlib/ticker.py b/lib/matplotlib/ticker.py index 1fc3de76d8bc..b798037de52d 100644 --- a/lib/matplotlib/ticker.py +++ b/lib/matplotlib/ticker.py @@ -197,16 +197,7 @@ def _divmod(x, y): def _mathdefault(s): - """ - For backward compatibility, in classic mode we display - sub/superscripted text in a mathdefault block. As of 2.0, the - math font already matches the default font, so we don't need to do - that anymore. - """ - if rcParams['_internal.classic_mode']: - return '\\mathdefault{%s}' % s - else: - return '{%s}' % s + return '\\mathdefault{%s}' % s class _DummyAxis(object):