How to plot tick values in-place?

Hello
I didn't find an answer with google or stackoverflow, maybe someone here
can help? The code:

import matplotlib.pyplot as plot
plot.plot([0, 1e-9, 0, -1e-9])
plot.show()

produces a plot in which y ticks are -1, -0.5, 0, 0.5, 1 and their
scaling is plotted elsewhere, how do I force matplotlib to plot the tics
in-place as -1e-9, -0.5-e9... so I don't have to search other parts of
the plot for potential corrections to tick values? Thanks!
Ilja

I think setting the rcParam 'axes.formatter.useoffset' to False prior to
any plotting would do the trick.

plot.rcParams['axes.formatter.useoffset'] = False

Untested, though.

Ben Root

···

On Wed, Feb 10, 2016 at 12:06 PM, Ilja Honkonen <ilja.j.honkonen at nasa.gov> wrote:

Hello
I didn't find an answer with google or stackoverflow, maybe someone here
can help? The code:

import matplotlib.pyplot as plot
plot.plot([0, 1e-9, 0, -1e-9])
plot.show()

produces a plot in which y ticks are -1, -0.5, 0, 0.5, 1 and their scaling
is plotted elsewhere, how do I force matplotlib to plot the tics in-place
as -1e-9, -0.5-e9... so I don't have to search other parts of the plot for
potential corrections to tick values? Thanks!
Ilja
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users at python.org
https://mail.python.org/mailman/listinfo/matplotlib-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20160210/63ce7d0f/attachment.html>

I think setting the rcParam '|axes.formatter.useoffset' |to False prior
to any plotting would do the trick.|
>plot.rcParams['axes.formatter.useoffset'] = False

My matplotlib.__version__ == '1.1.1' doesn't have that neither in
matplotlib nor in plot:

>>> matplotlib.rcParams['axes.formatter.useoffset'] = False
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File
"/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py",
line 660, in __setitem__
     See rcParams.keys() for a list of valid parameters.' % (key,))
KeyError: 'axes.formatter.useoffset is not a valid rc parameter.See
rcParams.keys() for a list of valid parameters.'

>>> matplotlib.pyplot.rcParams['axes.formatter.useoffset'] = False
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File
"/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py",
line 660, in __setitem__
     See rcParams.keys() for a list of valid parameters.' % (key,))
KeyError: 'axes.formatter.useoffset is not a valid rc parameter.See
rcParams.keys() for a list of valid parameters.'

Also I did find this: plot.ticklabel_format(useOffset = False) which
looks like what you suggest but that only removes offset from ticks not
scaling. Thanks

Ilja