On Fri, Sep 24, 2010 at 5:47 PM, Russell E. Owen <ro...@uw.edu> wrote:

> In article
> <aanlktintbfs8owjelhopxs9x6dxenwykzqfehvqr5...@mail.gmail.com>,
>  Benjamin Root <ben.r...@ou.edu> wrote:
>
> > On Fri, Sep 24, 2010 at 12:30 PM, Russell E. Owen
> > <ro...@uw.edu> wrote:
> >
> > > I'm making a set of plots (a strip chart) stacked on top of each other,
> > > all sharing the same X axis (time).
> > >
> > > So far it appears that to get the X axis of each Subplot to match I
> have
> > > to set its properties independently.
> > >
> > > Is there some way to tie them all together so that a user can set the
> > > properties of one and have it propagate? I'm particularly concerned
> > > about tick marks and the X grid lines; I only want to show tick labels
> > > on the bottom-most Subplot.
> > >
> > > I suppose one possibility is to create some kind of object on which I
> > > can call Subplot.xaxis methods and have it apply those changes to all
> > > the Subplots. Has anyone done this?
> > >
> > > -- Russell
> > >
> > >
> > Russel, maybe this example might help?
> >
> >
> http://matplotlib.sourceforge.net/examples/pylab_examples/shared_axis_demo.htm
> > l
> >
> > There are also some more advanced subplot layout methods available called
> > axis_grid1 in the mpl_toolkits.
> >
> >
> http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.html
> >
> > I hope this helps!
> >
> > Ben Root
>
> Thank you. sharex was just what I was looking for.
>
> I was pleasantly surprised I could hide the x axis labels on the upper
> subplots using the following code:
>        for subplot in self.subplotArr[0:-1]:
>            # can't find API equivalent of pylab.setp so...
>            for ticklabel in subplot.get_xticklabels():
>                ticklabel.set_visible(False)
> since it's a strip chart and new X ticks are constantly being created as
> time advances. Thank heavens it doesn't show labels on the new ones.
>
>
Don't know if it is useful for you or not, but there is also the
.label_outer() function that will set the visibility of the axes tick labels
based on which subplot they are in the figure.


> I also tried axis_grid1 but was unable to get plots, and since the other
> technique is working and more backward-compatible I'm happy to stick to
> that.
>
>
axes_grid1 can be a little tricky to figure out at first, but once you get
the knack of it, it can be a powerful feature to use in the future.
However, I am glad that the other method works perfectly.

Ben Root
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to