On Thu, Nov 20, 2008 at 10:09 PM, Eric Firing <[EMAIL PROTECTED]> wrote: > 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) >>
I think there is a bug in poly_below -- try usin poly_between xv, yv = mlab.poly_between(xs, ys, 0) I've fixed the bug in svn r6429, so you can also use svn if you have access to it. JDH ------------------------------------------------------------------------- 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