Re: [Matplotlib-users] help with a custom formatter

2010-02-13 Thread C M
On Sat, Feb 13, 2010 at 3:00 PM, Jae-Joon Lee wrote: > If you're happy with the default formatter  behavior (which seems to > match with your #3 requirement), just reuse it. > > class MyFormatter(ScalarFormatter): >   def __call__(self, val, pos=None): >       if val < 0: >           return '' >  

Re: [Matplotlib-users] help with a custom formatter

2010-02-13 Thread Jae-Joon Lee
If you're happy with the default formatter behavior (which seems to match with your #3 requirement), just reuse it. class MyFormatter(ScalarFormatter): def __call__(self, val, pos=None): if val < 0: return '' else: return ScalarFormatter.__call__(self, val)

[Matplotlib-users] help with a custom formatter

2010-02-12 Thread C M
I would like a custom formatter that does 3 things: 1) Blanks out all the values less than 0. 2) Chooses appropriate major ticks when zoomed out. 3) Shows an integer when the zoom scale is revealing multiple integers, but shows a decimal number when it is just showing within one integer; i.e. if i