From: <ry...@us...> - 2008-12-05 15:56:33
|
Revision: 6497 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6497&view=rev Author: ryanmay Date: 2008-12-05 15:56:26 +0000 (Fri, 05 Dec 2008) Log Message: ----------- Add support for data with units to Axes.fill_between(). Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-12-05 14:48:45 UTC (rev 6496) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-12-05 15:56:26 UTC (rev 6497) @@ -5578,7 +5578,15 @@ %(PolyCollection)s """ - x = np.asarray(x) + # Handle united data, such as dates + self._process_unit_info(xdata=x, ydata=y1, kwargs=kwargs) + self._process_unit_info(ydata=y2) + + # Convert the arrays so we can work with them + x = np.asarray(self.convert_xunits(x)) + y1 = np.asarray(self.convert_yunits(y1)) + y2 = np.asarray(self.convert_yunits(y2)) + if not cbook.iterable(y1): y1 = np.ones_like(x)*y1 @@ -5588,8 +5596,6 @@ if where is None: where = np.ones(len(x), np.bool) - y1 = np.asarray(y1) - y2 = np.asarray(y2) where = np.asarray(where) assert( (len(x)==len(y1)) and (len(x)==len(y2)) and len(x)==len(where)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |