Revision: 4762
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4762&view=rev
Author:   mdboom
Date:     2007-12-18 05:02:33 -0800 (Tue, 18 Dec 2007)

Log Message:
-----------
Minor speed improvement

Modified Paths:
--------------
    branches/transforms/lib/matplotlib/scale.py

Modified: branches/transforms/lib/matplotlib/scale.py
===================================================================
--- branches/transforms/lib/matplotlib/scale.py 2007-12-17 18:29:04 UTC (rev 
4761)
+++ branches/transforms/lib/matplotlib/scale.py 2007-12-18 13:02:33 UTC (rev 
4762)
@@ -301,7 +301,10 @@
 
         def transform(self, a):
             masked = ma.masked_where((a < -self.thresh) | (a > self.thresh), a)
-            return ma.log(ma.tan(masked) + 1.0 / ma.cos(masked))
+            if masked.mask.any():
+                return ma.log(ma.abs(ma.tan(masked) + 1.0 / ma.cos(masked)))
+            else:
+                return npy.log(npy.abs(npy.tan(a) + 1.0 / npy.cos(a)))
 
         def inverted(self):
             return MercatorLatitudeScale.InvertedMercatorLatitudeTransform()
@@ -346,6 +349,7 @@
     def limit_range_for_scale(self, vmin, vmax, minpos):
         return max(vmin, -self.thresh), min(vmax, self.thresh)
 
+
 _scale_mapping = {
     'linear'            : LinearScale,
     'log'               : LogScale,


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

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to