diff scripts/plot/__quiver__.m @ 8070:3b53b25e2550

Add data sources and line series
author David Bateman <dbateman@free.fr>
date Thu, 28 Aug 2008 12:23:54 -0400
parents 9a6f4713f765
children a028a5960e18
line wrap: on
line diff
--- a/scripts/plot/__quiver__.m	Thu Aug 28 10:20:43 2008 -0400
+++ b/scripts/plot/__quiver__.m	Thu Aug 28 12:23:54 2008 -0400
@@ -75,6 +75,7 @@
 
   have_filled = false;
   have_line_spec = false;
+  args = {};
   while (ioff <= nargin)
     arg = varargin{ioff++};
     if (ischar (arg) && strncmp (tolower (arg), "filled", 6))
@@ -88,10 +89,16 @@
 	  linespec.linestyle = "-";
 	endif
       else
-	error ("quiver: invalid linespec");
+	args {end + 1} = arg;
+        if (ioff <= nargin)
+          args {end + 1} = varargin{ioff++};
+        endif
       endif
     else
-      error ("quiver: unrecognized argument");
+      args {end + 1} = arg;
+      if (ioff <= nargin)
+        args {end + 1} = varargin{ioff++};
+      endif
     endif
   endwhile
 
@@ -120,6 +127,13 @@
   hstate = get (h, "nextplot");
   unwind_protect
     hg = hggroup ();
+    if (is3d)
+      args = __add_datasource__ ("quiver3", hg, 
+				 {"x", "y", "z", "u", "v", "w"}, args{:});
+    else
+      args = __add_datasource__ ("quiver", hg, 
+				 {"x", "y", "z", "u", "v", "w"}, args{:});
+    endif
     hold on;
 
     addproperty ("xdata", hg, "data", x);
@@ -157,23 +171,23 @@
 		    [y.'; yend.'; NaN(1, length (y))](:),
 		    [z.'; zend.'; NaN(1, length (z))](:),
 		    "linestyle", linespec.linestyle, 
-		    "color", linespec.color, "parent", hg);
+		    "color", linespec.color, "parent", hg, args{:});
       else
 	h1 = plot ([x.'; xend.'; NaN(1, length (x))](:),
 		   [y.'; yend.'; NaN(1, length (y))](:),
 		   "linestyle", linespec.linestyle, 
-		    "color", linespec.color, "parent", hg);
+		    "color", linespec.color, "parent", hg, args{:});
       endif
     else
       if (is3d)
 	h1 = plot3 ([x.'; xend.'; NaN(1, length (x))](:),
 		    [y.'; yend.'; NaN(1, length (y))](:),
 		    [z.'; zend.'; NaN(1, length (z))](:),
-		    "parent", hg);
+		    "parent", hg, args{:});
       else
 	h1 = plot ([x.'; xend.'; NaN(1, length (x))](:),
 		   [y.'; yend.'; NaN(1, length (y))](:),
-		   "parent", hg);
+		   "parent", hg, args{:});
       endif
     endif