>>>>> "Eric" == Eric Firing <[EMAIL PROTECTED]> writes:

    Eric> The way axis sharing is implemented, everything is shared; a
    Eric> single axis object is used for more than one axes object.  I
    Eric> agree that this is not always what one wants, but I think it
    Eric> would be quite difficult to change, so for now you will need
    Eric> to forgo the sharey kwarg and instead manually synchronize
    Eric> the properties that you want the axes to have in common.
    Eric> Unless John has a better idea, of course...

This time I do :-)

The axis doesn't share everything -- it shares a locator and the view
limits.  When you do ylim([]) you are telling the y tick locator to
use no ticks, and this is shared.  There is a workaround -- no
terribly elegant but servicable, and one I use all the time.

Suppose ax1 and ax2 share the xaxis and you only want tick labels on
ax2

ax1 = fig.add_subplot(211)
ax2 = fig.add_subplot(212, sharex=ax1)
ax1.plot(something)
ax2.plot(somethingelse)

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

The key idea is that the actual ticks are not shared (they can't be
because their y locations are different).  But their x locations are
shared (which is why ax1.set_xlim([]) doesn't do what you want.  But
you can set the visibility property to make them invisible, which
works.

Should be a recipe in the cookbook, enterprising mailing list readers.

JDH

-------------------------------------------------------------------------
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