Hi Paul,

> The reason you were getting that error is because unless you
> specify otherwise, ax.bar will make the bottom of the bars at 0 -
> which isn't an allowed date, hence the error. Change your bar
> line to this (I also added align='center', but you can remove it
> if you want):

Aha, OK that makes sense.  Thank you.  I think the point #3 in my
previous email about the "Ordinal must be >= 1" has all been about
what is or isn't allowed as a proper date.

So your example worked of course, but I am still not able to get my
real code to plot a bar chart.  If I tell you what the format of the
data is, maybe you can help me.

I would like to plot dates (on x axis) versus time intervals (on y).
I have a list of dates and I have a two lists (self.data[0] and
self.data[1]), one of the start times ("bots") and one of the stop
times ("tops").  But when I go to plot it, and do this (based on your
code...for now leaving out the round() step):

 bots = self.data[0]
 tops = self.data[1]

bars = self.subplot.bar(self.final_dates, top-bot, bottom=bot, align='center')

I get the error:

TypeError: unsupported operand type(s) for -: 'list' and 'list'

Because I am trying to subtract the "bots" list from the "tops" list.
In the example code I gave, bot and times were not lists but were a
'numpy.ndarray' and a numpy.float64' object, respectfully, and I guess
the - operand can be used on them.

How can I structure my data such that this can work?  (For some reason
I have not had nearly this much confusion with plotting lines, just
bars).

Thanks for all the help,
Che (CM)

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to