changeset 5741:07421c4e0312

[project @ 2006-04-05 19:28:35 by jwe]
author jwe
date Wed, 05 Apr 2006 19:28:35 +0000
parents b2637e696bb4
children 2cd0af543e7a
files scripts/ChangeLog scripts/plot/__plt2__.m scripts/plot/__plt__.m
diffstat 3 files changed, 27 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Wed Apr 05 16:51:08 2006 +0000
+++ b/scripts/ChangeLog	Wed Apr 05 19:28:35 2006 +0000
@@ -1,3 +1,10 @@
+2006-04-05  John W. Eaton  <jwe@octave.org>
+
+	* plot/__plt2__.m: Return data = [] and fmtstr = "" if x1 and x2
+	are both empty.
+	* plot/__plt__.m: Ignore empty data and format strings returned
+	from __plt1__ or __plt2__.
+
 2006-04-04  Bob Weigel  <rweigel@gmu.edu>
 
         * scripts/set/unique.m: Properly handle single column input when
--- a/scripts/plot/__plt2__.m	Wed Apr 05 16:51:08 2006 +0000
+++ b/scripts/plot/__plt2__.m	Wed Apr 05 19:28:35 2006 +0000
@@ -67,6 +67,9 @@
     else
       error ("__plt2__: invalid data for plotting");
     endif
+  elseif (isempty (x1) && isempty (x2))
+    data = [];
+    fmtstr = "";
   else
     error ("__plt2__: invalid data for plotting");
   endif
--- a/scripts/plot/__plt__.m	Wed Apr 05 16:51:08 2006 +0000
+++ b/scripts/plot/__plt__.m	Wed Apr 05 19:28:35 2006 +0000
@@ -56,11 +56,15 @@
 	if (x_set)
 	  fmt = __pltopt__ (caller, next_arg);
 	  if (y_set)
-	    [__plot_data__{__current_figure__}{__multiplot_xi__,__multiplot_yi__}{j}, fmtstr] = __plt2__ (x, y, fmt);
+	    [tdata, tfmtstr] = __plt2__ (x, y, fmt);
 	  else
-	    [__plot_data__{__current_figure__}{__multiplot_xi__,__multiplot_yi__}{j}, fmtstr] = __plt1__ (x, fmt);
+	    [tdata, tfmtstr] = __plt1__ (x, fmt);
 	  endif
-	  have_data = true;
+	  if (! isempty (tdata))
+	    __plot_data__{__current_figure__}{__multiplot_xi__,__multiplot_yi__}{j} = tdata;
+	    fmtstr = tfmtstr;
+	    have_data = true;
+	  endif
 	  x_set = false;
 	  y_set = false;
 	else
@@ -69,8 +73,12 @@
       elseif (x_set)
 	if (y_set)
 	  fmt = __pltopt__ (caller, "");
-	  [__plot_data__{__current_figure__}{__multiplot_xi__,__multiplot_yi__}{j}, fmtstr] = __plt2__ (x, y, fmt);
-	  have_data = true;
+	  [tdata, tfmtstr] = __plt2__ (x, y, fmt);
+	  if (! isempty (tdata))
+	    __plot_data__{__current_figure__}{__multiplot_xi__,__multiplot_yi__}{j} = tdata;
+	    fmtstr = tfmtstr;
+	    have_data = true;
+	  endif
 	  x = next_arg;
 	  y_set = false;
 	else
@@ -105,10 +113,10 @@
 
     __plot_data_offset__{__current_figure__}(__multiplot_xi__,__multiplot_yi__) = j;
 
-    if (! isempty (__plot_command__{__current_figure__}{__multiplot_xi__,__multiplot_yi__}))
-      if (__multiplot_mode__)
-	__gnuplot_raw__ ("clear\n");
-      endif
+    if (__multiplot_mode__)
+      __gnuplot_raw__ ("clear\n");
+    endif
+    if (! strcmp (__plot_command__{__current_figure__}{__multiplot_xi__,__multiplot_yi__}, "__gnuplot_plot__"))
       eval (__plot_command__{__current_figure__}{__multiplot_xi__,__multiplot_yi__});
     endif