SF.net SVN: matplotlib:[7103] trunk/matplotlib/lib/matplotlib/quiver.py

2009-05-15 Thread efiring
Revision: 7103
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7103&view=rev
Author:   efiring
Date: 2009-05-16 01:01:49 + (Sat, 16 May 2009)

Log Message:
---
Fixed bugs in quiver affecting angles passed in as a sequence

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

Modified: trunk/matplotlib/lib/matplotlib/quiver.py
===
--- trunk/matplotlib/lib/matplotlib/quiver.py   2009-05-14 06:27:58 UTC (rev 
7102)
+++ trunk/matplotlib/lib/matplotlib/quiver.py   2009-05-16 01:01:49 UTC (rev 
7103)
@@ -479,11 +479,12 @@
 length = a/(self.scale*self.width)
 X, Y = self._h_arrows(length)
 if self.angles == 'xy':
-theta = self._angles(U, V).filled(0)[:,np.newaxis]
+theta = self._angles(U, V).filled(0)
 elif self.angles == 'uv':
-theta = np.angle(ma.asarray(uv[..., np.newaxis]).filled(0))
+theta = np.angle(uv.filled(0))
 else:
-theta = ma.asarray(self.angles*np.pi/180.0).filled(0)
+theta = ma.asarray(self.angles).filled(0)*np.pi/180.0
+theta.shape = (theta.shape[0], 1) # for broadcasting
 xy = (X+Y*1j) * np.exp(1j*theta)*self.width
 xy = xy[:,:,np.newaxis]
 XY = ma.concatenate((xy.real, xy.imag), axis=2)


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

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib:[7104] trunk/matplotlib/lib/matplotlib/quiver.py

2009-05-15 Thread efiring
Revision: 7104
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7104&view=rev
Author:   efiring
Date: 2009-05-16 02:22:57 + (Sat, 16 May 2009)

Log Message:
---
Make quiver handle nans and infs

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

Modified: trunk/matplotlib/lib/matplotlib/quiver.py
===
--- trunk/matplotlib/lib/matplotlib/quiver.py   2009-05-16 01:01:49 UTC (rev 
7103)
+++ trunk/matplotlib/lib/matplotlib/quiver.py   2009-05-16 02:22:57 UTC (rev 
7104)
@@ -388,9 +388,9 @@
 X, Y, U, V, C = [None]*5
 args = list(args)
 if len(args) == 3 or len(args) == 5:
-C = ma.asarray(args.pop(-1))
-V = ma.asarray(args.pop(-1))
-U = ma.asarray(args.pop(-1))
+C = ma.masked_invalid(args.pop(-1), copy=False)
+V = ma.masked_invalid(args.pop(-1), copy=False)
+U = ma.masked_invalid(args.pop(-1), copy=False)
 if U.ndim == 1:
 nr, nc = 1, U.shape[0]
 else:
@@ -483,7 +483,8 @@
 elif self.angles == 'uv':
 theta = np.angle(uv.filled(0))
 else:
-theta = ma.asarray(self.angles).filled(0)*np.pi/180.0
+theta = ma.masked_invalid(self.angles, copy=False).filled(0)
+theta *= (np.pi/180.0)
 theta.shape = (theta.shape[0], 1) # for broadcasting
 xy = (X+Y*1j) * np.exp(1j*theta)*self.width
 xy = xy[:,:,np.newaxis]
@@ -919,9 +920,9 @@
 X, Y, U, V, C = [None]*5
 args = list(args)
 if len(args) == 3 or len(args) == 5:
-C = ma.asarray(args.pop(-1)).ravel()
-V = ma.asarray(args.pop(-1))
-U = ma.asarray(args.pop(-1))
+C = ma.masked_invalid(args.pop(-1), copy=False).ravel()
+V = ma.masked_invalid(args.pop(-1), copy=False)
+U = ma.masked_invalid(args.pop(-1), copy=False)
 nn = np.shape(U)
 nc = nn[0]
 nr = 1
@@ -937,10 +938,10 @@
 return X, Y, U, V, C
 
 def set_UVC(self, U, V, C=None):
-self.u = ma.asarray(U).ravel()
-self.v = ma.asarray(V).ravel()
+self.u = ma.masked_invalid(U, copy=False).ravel()
+self.v = ma.masked_invalid(V, copy=False).ravel()
 if C is not None:
-c = ma.asarray(C).ravel()
+c = ma.masked_invalid(C, copy=False).ravel()
 x,y,u,v,c = delete_masked_points(self.x.ravel(), self.y.ravel(),
 self.u, self.v, c)
 else:


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

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins