Mercurial > hg > octave-lyh
diff scripts/plot/__plt2mm__.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/__plt2mm__.m +++ b/scripts/plot/__plt2mm__.m @@ -25,19 +25,29 @@ msg = sprintf ("__plt2mm__ (x, y)\n"); msg = sprintf ("%s __plt2mm__ (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); [y_nr, y_nc] = size (y); + k = 1; + fmt_nr = rows (fmt); if (x_nr == y_nr && x_nc == y_nc) if (x_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:x_nc - cmd = sprintf ("%s, tmp(:,%d:%d:%d) %s", cmd, i, x_nc, x_nc+i, fmt); + cmd = sprintf ("%s, tmp(:,%d:%d:%d) %s", cmd, i, x_nc, x_nc+i, + deblank (fmt (k, :))); + if (k < fmt_nr) + k++; + endif endfor eval (cmd); else