On Fri, Mar 12, 2010 at 1:15 PM, Alex S <schmitt.happ...@gmail.com> wrote: > Hi there, does anyone know if there's a simple way to set an axis limit to a > date? "viewlim_to_dt()" looks promising, but I can't figure out how to use > it...
If you've plotted using dates, just use dates for the limits: import matplotlib.pyplot as plt import numpy as np from datetime import datetime, timedelta s = datetime.now() x = np.array([s, s + timedelta(hours=3)]) y = np.arange(1,3) plt.plot(x,y) plt.xlim(s - timedelta(minutes=30), s + timedelta(hours=4)) plt.show() Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users