I placed that command before the ax.get_xticklabels(),
> and no dice.
> Thanks for looking into this, Mike
I took a look at the formatter code and it turns out it *does* know
the list of locations it has to format. I was wrong about this in my
previous post. The formatter has a locs attribute you can inspect to
see how many ticks there are. So you should be able to do something
like
class MyFormatter(ScalarFormatter):
def __call__(self, x, pos=None):
N = len(self.locs)
if pos==0: return '' # turn off first
elif pos==(N-1): return '' # turn off last
else: return ScalarFormatter(self, x, pos)
and you can do other things similarly, eg to turn off every other tick
if (pos%2)==0: return ''
If you want to get very clever with turning on and off certain ticks,
you can also create a custom locator derived from the Locator class
you are using.
JDH