From: <jr...@us...> - 2008-09-17 08:47:07
|
Revision: 6100 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6100&view=rev Author: jrevans Date: 2008-09-17 15:47:02 +0000 (Wed, 17 Sep 2008) Log Message: ----------- The previous fix broke the current behaviour of being able to explicitly set a new unit type for a specific axis after it was already set. This fixes that. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-09-17 02:10:58 UTC (rev 6099) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-09-17 15:47:02 UTC (rev 6100) @@ -1391,11 +1391,17 @@ if xunits!=self.xaxis.units: #print '\tkw setting xunits', xunits self.xaxis.set_units(xunits) + # If the units being set imply a different converter, we need to update. + if xdata is not None: + self.xaxis.update_units(xdata) yunits = kwargs.pop('yunits', self.yaxis.units) if yunits!=self.yaxis.units: #print '\tkw setting yunits', yunits self.yaxis.set_units(yunits) + # If the units being set imply a different converter, we need to update. + if ydata is not None: + self.yaxis.update_units(ydata) def in_axes(self, mouseevent): ''' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |