diff scripts/plot/__plt2vm__.m @ 3162:7c96e85c76db

[project @ 1998-04-08 18:19:35 by jwe]
author jwe
date Wed, 08 Apr 1998 18:21:04 +0000
parents 8b262e771614
children 9610d364e444
line wrap: on
line diff
--- a/scripts/plot/__plt2vm__.m
+++ b/scripts/plot/__plt2vm__.m
@@ -25,8 +25,8 @@
     msg = sprintf ("__plt2vm__ (x, y)\n");
     msg = sprintf ("%s              __plt2vm__ (x, y, fmt)", msg);
     usage (msg);
-  elseif (nargin == 2)
-    fmt = "";
+  elseif (nargin == 2 || fmt == "")
+    fmt = " ";  ## Yes, this is intentionally not an empty string!
   endif
 
   [x_nr, x_nc] = size (x);
@@ -50,11 +50,21 @@
     error ("__plt2vm__: matrix dimensions must match");
   endif
 
+  k = 1;
+  fmt_nr = rows (fmt);
   if (y_nc > 0)
     tmp = [x, y];
-    cmd = sprintf ("gplot tmp(:,%d:%d:%d) %s", 1, x_nc, x_nc+1, fmt);
+    cmd = sprintf ("gplot tmp(:,%d:%d:%d) %s", 1, x_nc, x_nc+1,
+		   deblank (fmt (k, :)));
+    if (k < fmt_nr)
+      k++;
+    endif
     for i = 2:y_nc
-      cmd = sprintf ("%s, tmp(:,%d:%d:%d) %s", cmd, 1, i, i+1, fmt);
+      cmd = sprintf ("%s, tmp(:,%d:%d:%d) %s", cmd, 1, i, i+1,
+		     deblank (fmt (k, :)));
+      if (k < fmt_nr)
+      	k++;
+      endif
     endfor
     eval (cmd);
   else