Revision: 7618
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7618&view=rev
Author:   ryanmay
Date:     2009-08-31 17:34:50 +0000 (Mon, 31 Aug 2009)

Log Message:
-----------
Use atleast_1d instead of asanyarray.  This allows passing in scalars to 
quiver/barbs.

Modified Paths:
--------------
    branches/v0_99_maint/lib/matplotlib/quiver.py

Modified: branches/v0_99_maint/lib/matplotlib/quiver.py
===================================================================
--- branches/v0_99_maint/lib/matplotlib/quiver.py       2009-08-31 17:29:41 UTC 
(rev 7617)
+++ branches/v0_99_maint/lib/matplotlib/quiver.py       2009-08-31 17:34:50 UTC 
(rev 7618)
@@ -323,16 +323,20 @@
 
     quiverkey_doc = _quiverkey_doc
 
+
 # This is a helper function that parses out the various combination of
 # arguments for doing colored vector plots.  Pulling it out here
 # allows both Quiver and Barbs to use it
 def _parse_args(*args):
     X, Y, U, V, C = [None]*5
     args = list(args)
+
+    # The use of atleast_1d allows for handling scalar arguments while also
+    # keeping masked arrays
     if len(args) == 3 or len(args) == 5:
-        C = np.asanyarray(args.pop(-1))
-    V = np.asanyarray(args.pop(-1))
-    U = np.asanyarray(args.pop(-1))
+        C = np.atleast_1d(args.pop(-1))
+    V = np.atleast_1d(args.pop(-1))
+    U = np.atleast_1d(args.pop(-1))
     if U.ndim == 1:
         nr, nc = 1, U.shape[0]
     else:


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
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to