diff scripts/plot/__plt__.m @ 5958:85c7dc4afe6b

[project @ 2006-08-23 18:35:38 by jwe]
author jwe
date Wed, 23 Aug 2006 18:35:39 +0000
parents 07421c4e0312
children 01556febbaaf
line wrap: on
line diff
--- a/scripts/plot/__plt__.m	Wed Aug 23 14:09:40 2006 +0000
+++ b/scripts/plot/__plt__.m	Wed Aug 23 18:35:39 2006 +0000
@@ -93,17 +93,19 @@
       if (have_data)
 	if (iscell (__plot_data__{__current_figure__}{__multiplot_xi__,__multiplot_yi__}{j}))
 	  for i = 1:length (__plot_data__{__current_figure__}{__multiplot_xi__,__multiplot_yi__}{j})
+	    usingstr = make_using_clause (__plot_data__{__current_figure__}{__multiplot_xi__,__multiplot_yi__}{j}{i});
 	    __plot_command__{__current_figure__}{__multiplot_xi__,__multiplot_yi__} \
-		= sprintf ("%s%s __plot_data__{__current_figure__}{__multiplot_xi__,__multiplot_yi__}{%d}{%d} %s",
+		= sprintf ("%s%s __plot_data__{__current_figure__}{__multiplot_xi__,__multiplot_yi__}{%d}{%d} %s %s",
 			   __plot_command__{__current_figure__}{__multiplot_xi__,__multiplot_yi__},
-			   __plot_command_sep__, j, i, fmtstr{i});
+			   __plot_command_sep__, j, i, usingstr, fmtstr{i});
 	    __plot_command_sep__ = ",\\\n";
 	  endfor
 	else
+	  usingstr = make_using_clause (__plot_data__{__current_figure__}{__multiplot_xi__,__multiplot_yi__}{j});
 	  __plot_command__{__current_figure__}{__multiplot_xi__,__multiplot_yi__} \
-	    = sprintf ("%s%s __plot_data__{__current_figure__}{__multiplot_xi__,__multiplot_yi__}{%d} %s",
+	    = sprintf ("%s%s __plot_data__{__current_figure__}{__multiplot_xi__,__multiplot_yi__}{%d} %s %s",
 		       __plot_command__{__current_figure__}{__multiplot_xi__,__multiplot_yi__},
-		       __plot_command_sep__, j, fmtstr);
+		       __plot_command_sep__, j, usingstr, fmtstr);
 	  __plot_command_sep__ = ",\\\n";
 	endif
 	j++;
@@ -127,4 +129,16 @@
     usage (msg);
   endif
 
-endfunction
+## endfunction
+
+function usingstr = make_using_clause (x)
+  cols = columns (x);
+  if (cols > 0)
+    usingstr = strcat (gnuplot_command_using, " ($1)");
+    for k = 2:cols
+      usingstr = sprintf ("%s:($%d)", usingstr, k);
+    endfor
+  else
+    usingstr = "";
+  endif
+## endfunction