changeset 11822:54fcba82201b release-3-0-x

__go_draw_axes__.m (__gnuplot_write_data__): write "Inf Inf\n" if all data pairs contain NaN values
author John W. Eaton <jwe@octave.org>
date Thu, 21 Aug 2008 15:28:58 -0400
parents 018dff0b30d2
children 8f28953882c2
files scripts/ChangeLog scripts/plot/__go_draw_axes__.m
diffstat 2 files changed, 20 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -1,3 +1,9 @@
+2008-08-21  John W. Eaton  <jwe@octave.org>
+
+	* plot/__go_draw_axes__.m: Fix test for have_data.
+	(__gnuplot_write_data__): Write "Inf Inf\n" if all data pairs
+	contain NaN values.
+
 2008-07-28  David Bateman  <dbateman@free.fr>
  
 	* plot/contourf.m: Allow X,Y to be unequal vectors.
--- a/scripts/plot/__go_draw_axes__.m
+++ b/scripts/plot/__go_draw_axes__.m
@@ -1013,7 +1013,7 @@
       fputs (plot_stream, "unset hidden3d;\n");
     endif
 
-    have_data = (! (isempty (data) || any (cellfun (@isempty, data))));
+    have_data = (! (isempty (data) || all (cellfun (@isempty, data))));
 
     if (isempty (xlim))
       return;
@@ -1447,15 +1447,19 @@
       n = columns (data);
       have_nans = true;
       num_nan_elts = numel (nan_elts);
-      k = 1;
-      for i = 1:n
-	if (have_nans && i == nan_elts(k))
-	  fputs (plot_stream, "\n");
-	  have_nans = ++k <= num_nan_elts;
-	else
-	  fprintf (plot_stream, fmt, data(:,i));
-	endif
-      endfor
+      if (num_nan_elts == n)
+	fputs (plot_stream, "Inf Inf\n");
+      else
+	k = 1;
+	for i = 1:n
+	  if (have_nans && i == nan_elts(k))
+	    fputs (plot_stream, "\n");
+	    have_nans = ++k <= num_nan_elts;
+	  else
+	    fprintf (plot_stream, fmt, data(:,i));
+	  endif
+	endfor
+      endif
     endif
   elseif (nd == 3)
     ## FIXME -- handle NaNs here too?