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
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users