From: <jr...@us...> - 2008-01-08 18:57:24
|
Revision: 4811 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4811&view=rev Author: jrevans Date: 2008-01-08 10:57:23 -0800 (Tue, 08 Jan 2008) Log Message: ----------- Added some logic to Axes.bar that will preconvert unitized data before creating the rectangular Patch since not all unitized data can be subtracted with a floating point number (ie. 'left - width') this is especially true with 'time' (time - time = duration). This problem can be seen when passing in a floating-point number for the width, which in-turn should be interpreted to be a number in the units for the axis. This was not being done, and now is. There is probably a better way to handle this. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-01-08 18:45:40 UTC (rev 4810) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-01-08 18:57:23 UTC (rev 4811) @@ -3264,7 +3264,21 @@ patches = [] + # lets do some conversions now since some types cannot be subtracted uniformly + if self.xaxis is not None: + xconv = self.xaxis.converter + if xconv is not None: + units = self.xaxis.get_units() + left = xconv.convert( left, units ) + width = xconv.convert( width, units ) + if self.yaxis is not None: + yconv = self.yaxis.converter + if yconv is not None : + units = self.yaxis.get_units() + bottom = yconv.convert( bottom, units ) + height = yconv.convert( height, units ) + if align == 'edge': pass elif align == 'center': This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |