From: <ef...@us...> - 2010-05-21 18:26:19
|
Revision: 8331 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8331&view=rev Author: efiring Date: 2010-05-21 18:26:12 +0000 (Fri, 21 May 2010) Log Message: ----------- Fix bug introduced in 8308: allow vmin == vmax Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/colors.py trunk/matplotlib/lib/matplotlib/dates.py Modified: trunk/matplotlib/lib/matplotlib/colors.py =================================================================== --- trunk/matplotlib/lib/matplotlib/colors.py 2010-05-20 17:22:54 UTC (rev 8330) +++ trunk/matplotlib/lib/matplotlib/colors.py 2010-05-21 18:26:12 UTC (rev 8331) @@ -810,11 +810,8 @@ def inverse(self, value): if not self.scaled(): raise ValueError("Not invertible until scaled") - vmin, vmax = self.vmin, self.vmax - if vmin >= vmax: - raise ValueError("Inversion requires valid vmax > vmin") - vmin = float(vmin) - vmax = float(vmax) + vmin = float(self.vmin) + vmax = float(self.vmax) if cbook.iterable(value): val = ma.asarray(value) Modified: trunk/matplotlib/lib/matplotlib/dates.py =================================================================== --- trunk/matplotlib/lib/matplotlib/dates.py 2010-05-20 17:22:54 UTC (rev 8330) +++ trunk/matplotlib/lib/matplotlib/dates.py 2010-05-21 18:26:12 UTC (rev 8331) @@ -512,7 +512,7 @@ Return the number of units for each tick. """ return 1 - + def nonsingular(self, vmin, vmax): unit = self._get_unit() interval = self._get_interval() @@ -561,7 +561,7 @@ if estimate > self.MAXTICKS * 2: raise RuntimeError( 'RRuleLocator estimated to generate %d ticks from %s to %s: exceeds Locator.MAXTICKS * 2 (%d) ' % (estimate, dmin, dmax, self.MAXTICKS * 2)) - + dates = self.rule.between(dmin, dmax, True) if len(dates) == 0: return date2num([dmin, dmax]) @@ -597,7 +597,7 @@ def _get_interval(self): return self.rule._rrule._interval - + def autoscale(self): """ Set the view limits to include the data range. @@ -868,7 +868,7 @@ vmax = date2num(vmax) return self.nonsingular(vmin, vmax) - + class MonthLocator(RRuleLocator): """ Make ticks on occurances of each month month, eg 1, 3, 12. @@ -925,7 +925,7 @@ interval=interval, **self.hms0d) RRuleLocator.__init__(self, o, tz) - + class HourLocator(RRuleLocator): """ Make ticks on occurances of each hour. @@ -943,7 +943,7 @@ byminute=0, bysecond=0) RRuleLocator.__init__(self, rule, tz) - + class MinuteLocator(RRuleLocator): """ Make ticks on occurances of each minute. @@ -961,7 +961,7 @@ bysecond=0) RRuleLocator.__init__(self, rule, tz) - + class SecondLocator(RRuleLocator): """ Make ticks on occurances of each second. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |