diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index d7e53c40bb7d..ff136f67a270 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -85,6 +85,7 @@ def test_formatter_large_small(): fig, ax = plt.subplots(1) x = [0.500000001, 0.500000002] y = [1e64, 1.1e64] + ax.ticklabel_format(useOffset=True) ax.plot(x, y) @image_comparison(baseline_images=["twin_axis_locaters_formatters"]) diff --git a/lib/matplotlib/tests/test_subplots.py b/lib/matplotlib/tests/test_subplots.py index 99273a8446b1..f3a40bdbd295 100644 --- a/lib/matplotlib/tests/test_subplots.py +++ b/lib/matplotlib/tests/test_subplots.py @@ -112,6 +112,8 @@ def test_subplots_offsettext(): x = numpy.arange(0,1e10,1e9) y = numpy.arange(0,100,10)+1e4 fig,axes = plt.subplots(2,2, sharex = 'col', sharey = 'all') + for ax in axes: + ax.ticklabel_format(useOffset=True) axes[0,0].plot(x,x) axes[1,0].plot(x,x) axes[0,1].plot(y,x) diff --git a/lib/matplotlib/ticker.py b/lib/matplotlib/ticker.py index 240d02eb0a82..ed55ac219cb9 100644 --- a/lib/matplotlib/ticker.py +++ b/lib/matplotlib/ticker.py @@ -356,7 +356,7 @@ class ScalarFormatter(Formatter): """ - def __init__(self, useOffset=True, useMathText=None, useLocale=None): + def __init__(self, useOffset=False, useMathText=None, useLocale=None): # useOffset allows plotting small data ranges with large offsets: for # example: [1+1e-9,1+2e-9,1+3e-9] useMathText will render the offset # and scientific notation in mathtext