Revision: 8605
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8605&view=rev
Author:   leejjoon
Date:     2010-07-31 09:18:20 +0000 (Sat, 31 Jul 2010)

Log Message:
-----------
improve FixedLocator in axisartist module

Modified Paths:
--------------
    trunk/matplotlib/lib/mpl_toolkits/axisartist/grid_finder.py

Modified: trunk/matplotlib/lib/mpl_toolkits/axisartist/grid_finder.py
===================================================================
--- trunk/matplotlib/lib/mpl_toolkits/axisartist/grid_finder.py 2010-07-31 
09:06:08 UTC (rev 8604)
+++ trunk/matplotlib/lib/mpl_toolkits/axisartist/grid_finder.py 2010-07-31 
09:18:20 UTC (rev 8605)
@@ -279,13 +279,19 @@
 class FixedLocator(object):
     def __init__(self, locs):
         self._locs = locs
+        self._factor = None
 
 
     def __call__(self, v1, v2):
-        v1, v2 = sorted([v1, v2])
+        if self._factor is None:
+            v1, v2 = sorted([v1, v2])
+        else:
+            v1, v2 = sorted([v1*self._factor, v2*self._factor])
         locs = np.array([l for l in self._locs if ((v1 <= l) and (l <= v2))])
-        return locs, len(locs), None
+        return locs, len(locs), self._factor
 
+    def set_factor(self, f):
+        self._factor = f
 
 
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to