On Aug 31, 2006, at 4:36 AM, John Hunter wrote:
> So: how do you solve your problem, of making the first tick invisible?
> What I do when I need to solve this problem, which comes up a lot with
> multiple axes where ticks can overlap, is the following
>
> from matplotlib.ticker import ScalarFormatter
>
> class MyFormatter(ScalarFormatter):
>     def __call__(self, x, pos=None):
>         if pos==0: return ''
>         else: return ScalarFormatter(self, x, pos)
>
> ax.xaxis.set_major_formatter(MyFormatter())
>
> I often want to do this for the last tick as well, but there is
> currently no convenient way to do this, as the tick locator produces
> the tick location list and the tick formatter doesn't know how many of
> them there are.  I've been considering modifying the tick locator code
> to pass -1 for the pos for the last tick to solve just this use case.
> If others need this or think it desirable, just give me a nudge and
> I'll do it.

Hi John,

Hmm.... I have 3 use cases where I want to isolate individual tick  
labels and make them invisible:

1) the first tick (0; for stacked plots)
2) the last tick (-1; for stacked plots)
3) every other tick for the last few ticks (e.g. -2, -4, -6; for a  
log-scale axis with large tick labels, which can overlap on one end)

Is there a way to force some sort of pseudo-draw event, such that the  
sizing is done and the ticks are created from the protoTick, but the  
draw isn't actually performed by the backend?  That way one could set  
the visibility property rather than wrap the Formatter.

Thanks,
Mike



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to