Shailesh Kochhar wrote: > Hello, > > I am trying to fill the space below a curve where my x-axis is indexed > by time. The matplotlib api documentation and the examples don't touch > on this subject and I haven't had much luck trying a few different > variations. Here's what I've tried so far, maybe someone can point out > what I'm doing wrong. > > import time > import matplotlib.pyplot as plt > import matplotlib.mlab as mlab > > time_strings = [ list of times as strings ] > xs = [ date2num(time.strptime(string) for string in time_strings ] > ys = [ list of float values ] > > fig = plt.figure() > ax = fig.add_subplot(111) > ax.plot_date(xs, ys) > > xv, yv = mlab.poly_below(0, xs, ys) > ax.fill(xv, yv) > > > When I do this, I get a 'year out of range' error. If I try and fill the > area before the call to ax.plot_date, The fill looks like a solid bar > about the height of the max y-value.
What is the actual traceback? Please provide a simple but complete example that shows the problem--that is, flesh out your pseudocode above into a small standalone script that triggers the error. Eric > > From, looking at the posts on the mailing list it doesn't seem that I'm > doing something terribly wrong, maybe I'm missing something subtle? > > Thanks, > - Shailesh > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users