diff scripts/plot/__plt__.m @ 6172:2de853a110df

[project @ 2006-11-15 22:53:47 by jwe]
author jwe
date Wed, 15 Nov 2006 22:53:48 +0000
parents a3cd9e6fcd9c
children 44c91c5dfe1d
line wrap: on
line diff
--- a/scripts/plot/__plt__.m	Wed Nov 15 20:03:18 2006 +0000
+++ b/scripts/plot/__plt__.m	Wed Nov 15 22:53:48 2006 +0000
@@ -31,7 +31,7 @@
   mxi = __multiplot_xi__(cf);
   myi = __multiplot_yi__(cf);
 
-  __setup_plot__ ("__gnuplot_plot__");
+  __setup_plot__ ("plot");
 
   nargs = nargin ();
 
@@ -39,8 +39,6 @@
 
     k = 1;
     j = __plot_data_offset__{cf}(mxi,myi);
-    loff = __plot_line_offset__{cf}(mxi,myi);
-    loff1 = loff;
 
     x_set = false;
     y_set = false;
@@ -56,8 +54,6 @@
 	next_arg = varargin{k++};
       endif
 
-      have_data = false;
-
       if (ischar (next_arg) || iscellstr (next_arg))
 	if (x_set)
 	  [fmt, keystr] = __pltopt__ (caller, next_arg);
@@ -67,12 +63,16 @@
 	    [tdata, tfmtstr, key] = __plt1__ (x, fmt, keystr);
 	  endif
 	  if (! isempty (tdata))
+	    for i = 1:numel (tdata)
+	      __plot_usingstr__{cf}{mxi,myi}{j}{i} ...
+		  = __make_using_clause__ (tdata{i});
+	      __plot_withstr__{cf}{mxi,myi}{j}{i} = "";
+	    endfor
 	    __plot_data__{cf}{mxi,myi}{j} = tdata;
-	    for i = 1:length (key)
-	      __plot_key_labels__{cf}{mxi,myi}{loff1++} = key{i};
-	    endfor
-	    fmtstr = tfmtstr;
-	    have_data = true;
+	    __plot_data_type__{cf}{mxi,myi}(j) = 2;
+	    __plot_fmtstr__{cf}{mxi,myi}{j} = tfmtstr;
+	    __plot_key_labels__{cf}{mxi,myi}{j} = key;
+	    j++;
 	  endif
 	  x_set = false;
 	  y_set = false;
@@ -84,12 +84,16 @@
 	  [fmt, keystr] = __pltopt__ (caller, {""});
 	  [tdata, tfmtstr, key] = __plt2__ (x, y, fmt, keystr);
 	  if (! isempty (tdata))
+	    for i = 1:numel (tdata)
+	      __plot_usingstr__{cf}{mxi,myi}{j}{i} ...
+		  = __make_using_clause__ (tdata{i});
+	      __plot_withstr__{cf}{mxi,myi}{j}{i} = "";
+	    endfor
 	    __plot_data__{cf}{mxi,myi}{j} = tdata;
-	    for i = 1:length (key)
-	      __plot_key_labels__{cf}{mxi,myi}{loff1++} = key{i};
-	    endfor
-	    fmtstr = tfmtstr;
-	    have_data = true;
+	    __plot_data_type__{cf}{mxi,myi}(j) = 2;
+	    __plot_fmtstr__{cf}{mxi,myi}{j} = tfmtstr;
+	    __plot_key_labels__{cf}{mxi,myi}{j} = key;
+	    j++;
 	  endif
 	  x = next_arg;
 	  y_set = false;
@@ -102,32 +106,11 @@
 	x_set = true;
       endif
 
-      if (have_data)
-	for i = 1:length (__plot_data__{cf}{mxi,myi}{j})
-	  usingstr = __make_using_clause__ (__plot_data__{cf}{mxi,myi}{j}{i});
-	  __plot_command__{cf}{mxi,myi} ...
-	      = sprintf ("%s%s __plot_data__{__current_figure__}{__multiplot_xi__(__current_figure__),__multiplot_yi__(__current_figure__)}{%d}{%d} %s %s %s __plot_key_labels__{__current_figure__}{__multiplot_xi__(__current_figure__),__multiplot_yi__(__current_figure__)}{%d}",
-			 __plot_command__{cf}{mxi,myi},
-			 __plot_command_sep__, j, i, usingstr,
-			 fmtstr{i}, gnuplot_command_title, loff++);
-	  __plot_command_sep__ = ",\\\n";
-	endfor
-	j++;
-      endif
-
     endwhile
 
     __plot_data_offset__{cf}(mxi,myi) = j;
-    __plot_line_offset__{cf}(mxi,myi) = loff;
 
-    if (__multiplot_mode__(cf))
-      __gnuplot_raw__ ("clear\n");
-    endif
-
-    if (! strcmp (__plot_command__{cf}{mxi,myi}, "__gnuplot_plot__"))
-      __do_legend__ ();
-      eval (__plot_command__{cf}{mxi,myi});
-    endif
+    __render_plot__ ();
 
   else
     msg = sprintf ("%s (y)\n", caller);