From: <jd...@us...> - 2009-11-23 20:27:13
|
Revision: 7980 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7980&view=rev Author: jdh2358 Date: 2009-11-23 20:26:44 +0000 (Mon, 23 Nov 2009) Log Message: ----------- make index formatter derive from base Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/dates.py trunk/matplotlib/lib/matplotlib/ticker.py Modified: trunk/matplotlib/lib/matplotlib/dates.py =================================================================== --- trunk/matplotlib/lib/matplotlib/dates.py 2009-11-23 03:38:11 UTC (rev 7979) +++ trunk/matplotlib/lib/matplotlib/dates.py 2009-11-23 20:26:44 UTC (rev 7980) @@ -454,6 +454,7 @@ return self._formatter(x, pos) + class rrulewrapper: def __init__(self, freq, **kwargs): Modified: trunk/matplotlib/lib/matplotlib/ticker.py =================================================================== --- trunk/matplotlib/lib/matplotlib/ticker.py 2009-11-23 03:38:11 UTC (rev 7979) +++ trunk/matplotlib/lib/matplotlib/ticker.py 2009-11-23 20:26:44 UTC (rev 7980) @@ -206,13 +206,14 @@ """ return s -class IndexFormatter: +class IndexFormatter(Formatter): """ format the position x to the nearest i-th label where i=int(x+0.5) """ def __init__(self, labels): self.labels = labels self.n = len(labels) + def __call__(self, x, pos=None): 'Return the format for tick val x at position pos; pos=None indicated unspecified' i = int(x+0.5) @@ -657,7 +658,7 @@ because the locator stores references to the Axis data and view limits """ - + # some automatic tick locators can generate so many ticks they # kill the machine when you try and render them, see eg sf bug # report @@ -673,7 +674,7 @@ 'raise a RuntimeError if Locator attempts to create more than MAXTICKS locs' if len(locs)>=self.MAXTICKS: raise RuntimeError('Locator attempting to generate %d ticks from %s to %s: exceeds Locator.MAXTICKS'%(len(locs), locs[0], locs[-1])) - + return locs def view_limits(self, vmin, vmax): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |