On Jan 31, 2008 6:03 AM, Thomas Tanner <[EMAIL PROTECTED]> wrote: > Hi, > I'd like to have figure with 3 (or 4) plots having different scales > but sharing the same x-axis. > Basically I want an extension of the twinx command (see, e.g, > two_scales.py demo). > I'm using 0.91.2svn on MacOSX10.5.1 from http://trichech.us/?page_id=5
[snip] > The 4th plot overwrites the ylim of the 1st plot (bug?). > Is there a limit of 3 axes per figure? > The ylim of plot4 is still ignored. > Why do I have to add the axes a1 and a4 the main axes to make them visible? I'm working on an app that has 8 axes per figure (X1, X2, Y1 ... Y4) and it works fine. Well, the MPL bits do. One of the unexpected things that we had to do in order to get the multiple plots to work as expected was to ensure that each additional subplot had its own label. MPL has some 'helper' code that tries to consolidate the axes so that if you create two axes with identical parameters, you only end up with one axes object (I think -- someone more knowledgeable can fill you in on the details). Now, we do things using the API rather than using pylab, some I'm not entirely certain (and haven't tested it) but I think that the pylab command 'axes' has an optional argument of 'label', which you should set to be a unique string for each subplot. I've only scanned through your code, and I'm not at all familiar with the pylab syntax, but I'm puzzled that you haven't used twinx (or in API parlance, sharex) anywhere. Regardless, the API code for overlaying subplots is of the form: figure.add_axes(axes1.get_position(), sharex=axes1, frameon=False, label='someUniqueString') Hope this helps, Anthony. ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users