|
From: Friedrich R. <fri...@gm...> - 2010-10-19 17:08:13
|
2010/10/18 Jonathan Slavin <js...@cf...>:
> I'm wondering if there's some relatively automatic way to have the
> ticklabels to come out in scientific notation for an axis that uses a
> linear scale (and has a range that warrants scientific notation)? For
> example, an axis that goes from 0 to 2.E18 by default uses the labels 0,
> 0.5, 1.0, 1.5, 2.0 and puts 1e18 at the end of the axis. To me this is
> unappealing. 1e18 is a computer programming way to write the 10^{18} (in
> LaTeX formatting). In IDL the ticklabels are 5.0x10^{17}, 1.0x10^{18},
> 1.5x10^{18}, 2.0x10^{18}. This is one instance where I think IDL gets
> it right and matplotlib gets it wrong. So, as far as I can tell, one
> can give the ticklabels by hand, and so I could achieve my desired
> labels that way, but it'd be nice to have a more automatic way to do it.
> Searching the examples, I've come up empty so far. I would also
> advocate changing the default format for labeling axes that fall in this
> category. Do the developers have any opinions on this?
There's a thread some monthes ago about this, I provided code to do
this. Currently, this Formatter class didn't make it into matplotlib
due a lack of providing a patch by me. If others agree that this
would be a good feature, I'll clean the code if necessary and provide
another patch for this.
Looking for the thread ...
http://article.gmane.org/gmane.comp.python.matplotlib.general/23824/match=scientific+notation+friedrich
IIRC, the formatter class does NOT provide automatic choice of
appropriate exponent, i.e. you have to provide this in instantiation
time.
hth, and let me know about any progress,
Friedrich
P.S.: I just gave the thread link and didn't look into it further.
But it should be the message I remembered.
|