On Sun, Nov 16, 2008 at 8:31 PM, Joshua J. Kugler <[EMAIL PROTECTED]> wrote:
> In opening: Thank you very much to Stan West and John Hunter for their
> help so far.
>
> OK, I've hit either a genuine bug in Matplotlib, or a serious gap in my
> understanding; probably the latter.  If I missed something in the docs,
> please point me that way.  Attached is a test case that shows what's
> going on, as well as the "bad" plots produced.
>
> I started with the two axis example.  After setting the formatters for
> ax1, I set the xmajor ticks labels' font size to 40, and plot it, as
> well as ax2.
>
> That gives me a set of large X labels, and a set of small X labels.  OK,
> I try setting ax2's major formatter to NullFormatter(), but that makes
> all the number disappear.
>
> As can be seen from the print statements, the instances of the
> formatters are the same for both ax1 and ax2, even though they are
> supposed to be different axis, BUT the instances of the tick labels are
> different, hence the disparity in font sizes.
>
> So, besides the work-around of setting font sizes on both sets of tick
> labels, what is the solution here?

When you share an axis, the formatters and locators are shared as
well.  I'm not sure if this is idea, but this is the way it is.  If
you want to turn off the tick labels for ax2, the trick is to make
them invisible, because the tick properties are not shared.  So
instead of using the NullLocator, do

for label in ax2.get_xticklabels():
    label.set_visible(False)

Hope this helps,
JDH

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to