Re: [Matplotlib-users] multiple (>2) y-axes
Here's some (incomplete) code snippets I used to place an extra x-axis below the normal one. I hope this helps. I agree that more axes can always be added at an arbitrary offset, although I did not try that. import numpy as N import matplotlib matplotlib.use("TkAgg") import pylab as PLT from matplotlib.font_manager import FontProperties # For setting legend font props. f1 = PLT.figure(1, figsize=(7.5,4.0)) ax1 = f1.add_axes([0.2, 0.25, 0.6, 0.6]) # This is "normal" axis PLT.hold(False) ax1.set_autoscale_on(False) # So that I can turn off autoscaling PLT.plot(lt, drift, '-', linewidth=3, label=legtext) # This axis is LT. Set the ticks manually. xticks = N.array([5.0, 8.0, 11.0, 14.0, 17.0, 20.0]) ax1.set_xticks(xticks.tolist()) ax1.set_autoscale_on(False) # So that I can turn off autoscaling # Now manually create the second axis (UT) slightly below PLT.hold(False) ax2 = f1.add_axes([0.2, 0.15, 0.6, 0.6], frameon=False) ax2.set_yticks([]) # Apply offset to get UT scale for second axis ax2.set_xlim([xticks[0]+offset, xticks[len(xticks)-1]+offset]) ax2.set_xticks((xticks+offset).tolist()) # Make tick lines invisible xtl = PLT.getp(ax2, 'xticklines') PLT.setp(xtl, 'visible', False) # Label the X ticks for first (LT) and second (UT) axes PLT.text(1.1, -0.1, 'LT', transform=ax1.transAxes) PLT.text(1.1, -0.25, 'UT', transform=ax1.transAxes) -Tony -- Tony Mannucci Supervisor, Ionospheric and Atmospheric Remote Sensing Group Mail-Stop 138-308, Tel > (818) 354-1699 Jet Propulsion Laboratory, Fax > (818) 393-5115 California Institute of Technology, Email > [EMAIL PROTECTED] 4800 Oak Grove Drive, http://genesis.jpl.nasa.gov Pasadena, CA 91109 - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] multiple (>2) y-axes
> On 10/5/07, James Boyle <[EMAIL PROTECTED]> wrote: >> I wish to plot 3 lines on a single graph - each line requires a >> separate y scaling but shares a common x. I have not >> found an example of 3 lines ( or greater). On Fri, 5 Oct 2007, John Hunter wrote: > This is on the wish list, but is currently unsupported. If you just need an EPS or PDF, you can use PyX: http://pyx.sourceforge.net/gallery/graphs/manyaxes.html hth, Alan Isaac - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] multiple (>2) y-axes
On 10/5/07, James Boyle <[EMAIL PROTECTED]> wrote: > I wish to plot 3 lines on a single graph - each line requires a > separate y scaling but shares a common x. > The case for 2 such lines is handled by twinx as in the two_scales.py > example. > > I have not found an example of 3 lines ( or greater). In the case of > more than 2 scales the y axis scale would have to float, to the right > or left of the y axes defined for the first 2 lines. This is on the wish list, but is currently unsupported. JDH - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] multiple (>2) y-axes
I wish to plot 3 lines on a single graph - each line requires a separate y scaling but shares a common x. The case for 2 such lines is handled by twinx as in the two_scales.py example. I have not found an example of 3 lines ( or greater). In the case of more than 2 scales the y axis scale would have to float, to the right or left of the y axes defined for the first 2 lines. Thanks for any help. ---Jim - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users