diff scripts/plot/__plt2mv__.m @ 6257:44c91c5dfe1d

[project @ 2007-01-30 19:16:52 by jwe]
author jwe
date Tue, 30 Jan 2007 19:16:55 +0000
parents 1a6d826e92b5
children cc2bee854d23
line wrap: on
line diff
--- a/scripts/plot/__plt2mv__.m
+++ b/scripts/plot/__plt2mv__.m
@@ -18,23 +18,23 @@
 ## 02110-1301, USA.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {[data, fmtstr] =} __plt2mv__ (@var{x}, @var{y}, @var{fmt})
+## @deftypefn {Function File} {} __plt2mv__ (@var{h}, @var{x}, @var{y}, @var{fmt}, @var{key})
 ## @end deftypefn
 
 ## Author: jwe
 
-function [data, fmtstr, key] = __plt2mv__ (x, y, fmt, keystr)
+function __plt2mv__ (h, x, y, fmt, key)
 
-  if (nargin < 2 || nargin > 4 || nargout < 2 || nargou > 3)
+  if (nargin < 3 || nargin > 5)
     print_usage ();
   endif
 
-  if (nargin < 3 || isempty (fmt))
+  if (nargin < 4 || isempty (fmt))
     fmt = {""};
   endif
 
-  if (nargin < 3 || isempty (keystr))
-    keystr = {""};
+  if (nargin < 5 || isempty (key))
+    key = {""};
   endif
 
   [x_nr, x_nc] = size (x);
@@ -62,21 +62,17 @@
     if (rows (fmt) == 1)
       fmt = repmat (fmt, x_nc, 1);
     endif
-    if (rows (keystr) == 1)
-      keystr = repmat (keystr, x_nc, 1);
+    if (rows (key) == 1)
+      key = repmat (key, x_nc, 1);
     endif
-    tmp = [x, y];
-    dtmp = cell (x_nc, 1);
-    ftmp = cell (x_nc, 1);
-    ktmp = cell (x_nc, 1);
     for i = 1:x_nc
-      dtmp{i} = tmp(:,[i,x_nc+1]);
-      ftmp{i} = deblank (fmt{i});
-      ktmp{i} = deblank (keystr{i});
+      ## FIXME -- need to handle labels and line format.
+      tkey = key{i};
+      if (! isempty (tkey))
+	set (h, "key", "on");
+      endif
+      line (x(:,i), y, "keylabel", tkey);
     endfor
-    data = dtmp;
-    fmtstr = ftmp;
-    key = ktmp;
   else
     error ("__plt2mv__: arguments must be a matrices");
   endif