Hi Ryan,
Thanks again,
Well your solution is also working.
I get very similar results with
class NiceSciFormatter(Formatter):
def __call__(self, x, pos=None):
a="%1.1E" % x
a=a[:5]+a[-1]
return a
It seems though that your solution enables more fine tuning !
Cheers,
On Thu, Sep 23, 2010 at 8:52 AM, Oz Nahum wrote:
> Hi Ryan,
>
> Thanks for your answer. However, I don't understand from the existing
> documentation how to use tickers.
>
> In the past I used the following method:
> class SciFormatter(Formatter):
> def __call__(self, x, pos=None):
> r
Hi Every, Hi Ryan
I finally solved this issue, which bothered me very long.
I managed to make a nicer scientific formatting on the xticks !
from pylab import *
import numpy as N
from matplotlib.ticker import Formatter,FuncFormatter
import os
#class to produce scientific format numbering
class
Hi Ryan,
Thanks for your answer. However, I don't understand from the existing
documentation how to use tickers.
In the past I used the following method:
class SciFormatter(Formatter):
def __call__(self, x, pos=None):
return "%1.1e" % x
axs.yaxis.set_major_formatter(SciFormatter())
On Thu, Sep 23, 2010 at 3:49 AM, Oz Nahum wrote:
> Hi Everyone,
>
> I don't like the default scientific formatting in matplotlib, IMHO the
> format of having a zero after the exponent is a waste of space in my opinion
> ...
> What I mean is that mpl is writing zero as:
> 0.0e+00 or 1.2e-03. IMHO i