2010/4/19 Friedrich Romstedt <friedrichromst...@gmail.com>:
> http://matplotlib.sourceforge.net/api/ticker_api.html#matplotlib.ticker.FuncFormatter

> For exponential ticks, I would propose (but it's untested):
>
>>>> def exp_fmt(loc):
>        exponent = numpy.round(numpy.log10(loc))
>        return '$10^%d$' % exponent
>>>> formatter = matplotlib.ticker.FuncFormatter(exp_fmt)
>>>> # And so on.

Well, as JJ pointed out recently, there is
matplotlib.ticker.LogFormatterMathtext as a much better template to
use ... Well, and even for scalar formatters, there is
matplotlib.ticker.ScalarFormatter(useMathText = True) ... Shame on me!

But it seems there is a small drawback: For non-rc-usetex mode,
\mathdefault{} is used, making the math typeset in the normal,
outside-math font (according to
http://matplotlib.sourceforge.net/users/mathtext.html?highlight=mathdefault#fonts).
 What is the advantage of using
matplotlib.ticker.ScalarFormatter(useMathText = True) then, when it's
typeset in outside-math font anyway?

Friedrich

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to