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)