Brad Chivari wrote:
> SUBJECT:
> Filtering out 0 bar height/width not working
> 
> FILE:
> matplotlib/ trunk/ matplotlib/ lib/ matplotlib/ axes.py
> 
> PROBLEM:
> xmin = np.amin(width[width!=0]) # filter out the 0 width rects
> ymin = np.amin(height[height!=0]) # filter out the 0 height rects
> 
> These aren't using proper python list comprehension and don't work as 
> expected (for me anyway).
> 
> SOLUTION:
> Shouldn't they be something like:
> xmin = np.amin([w for w in width if w != 0])
> ymin = np.amin([h for h in height if h != 0])
> 
> Once I changed them they seem to work properly.

I have applied a slight modification to your fix, which seems to me to 
be the right approach, given that the bar implementation is based on 
lists rather than ndarrays.

Thanks.

Eric

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to