C M, on 2011-01-27 13:56,  wrote:
> 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).

Che, 

just make a numpy array out of your two lists, and you'll be able
to subtract one from the other.

import numpy as np
top = np.array(top)
bot = np.array(bot)

best, 
-- 
Paul Ivanov
314 address only used for lists,  off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 

Attachment: signature.asc
Description: Digital signature

------------------------------------------------------------------------------
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