Mercurial > hg > octave-lojdl
changeset 8048:2f7ff06c0c7b
__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 | d54f113aa983 |
children | e36e891f2349 |
files | scripts/ChangeLog scripts/plot/__go_draw_axes__.m scripts/plot/print.m |
diffstat | 3 files changed, 21 insertions(+), 11 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-08-21 Thomas Treichl <Thomas.Treichl@gmx.net> * optimization/sqp.m: Increase test script tolerance.
--- 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?