Revision: 7637
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7637&view=rev
Author:   efiring
Date:     2009-09-05 18:55:08 +0000 (Sat, 05 Sep 2009)

Log Message:
-----------
Fix bug related to autoscaling and masked values in quiver

Modified Paths:
--------------
    trunk/matplotlib/lib/matplotlib/quiver.py

Modified: trunk/matplotlib/lib/matplotlib/quiver.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/quiver.py   2009-09-04 20:20:06 UTC (rev 
7636)
+++ trunk/matplotlib/lib/matplotlib/quiver.py   2009-09-05 18:55:08 UTC (rev 
7637)
@@ -498,7 +498,11 @@
         a = np.absolute(uv)
         if self.scale is None:
             sn = max(10, math.sqrt(self.N))
-            scale = 1.8 * a[~self.Umask].mean() * sn / self.span # crude 
auto-scaling
+            if self.Umask is not ma.nomask:
+                amean = a[~self.Umask].mean()
+            else:
+                amean = a.mean()
+            scale = 1.8 * amean * sn / self.span # crude auto-scaling
             self.scale = scale
         length = a/(self.scale*self.width)
         X, Y = self._h_arrows(length)


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

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to