# HG changeset patch # User John W. Eaton # Date 1219346938 14400 # Node ID 2f7ff06c0c7b0f28ea726b304c8a5afdc7788ccd # Parent d54f113aa9839a33022065acc0d0250b53bb0dea __go_draw_axes__.m (__gnuplot_write_data__): write "Inf Inf\n" if all data pairs contain NaN values diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,9 @@ +2008-08-21 John W. Eaton + + * 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-08-21 Thomas Treichl * optimization/sqp.m: Increase test script tolerance. diff --git a/scripts/plot/__go_draw_axes__.m b/scripts/plot/__go_draw_axes__.m --- a/scripts/plot/__go_draw_axes__.m +++ b/scripts/plot/__go_draw_axes__.m @@ -1021,7 +1021,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; @@ -1461,15 +1461,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? diff --git a/scripts/plot/print.m b/scripts/plot/print.m --- a/scripts/plot/print.m +++ b/scripts/plot/print.m @@ -423,7 +423,7 @@ endif if (! isempty (convertname)) - command = sprintf ("convert '%s' '%s'", name, convertname); + command = sprintf ("convert '%s' '%s'", name, convertname) [errcode, output] = system (command); unlink (name); if (errcode)