# HG changeset patch # User jwe # Date 1144265315 0 # Node ID 07421c4e0312972aff8fa513f891912535a29d21 # Parent b2637e696bb432e3afc823d30a4192e23dbe4ffe [project @ 2006-04-05 19:28:35 by jwe] diff -r b2637e696bb4 -r 07421c4e0312 scripts/ChangeLog --- 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 + + * 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 * scripts/set/unique.m: Properly handle single column input when diff -r b2637e696bb4 -r 07421c4e0312 scripts/plot/__plt2__.m --- 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 diff -r b2637e696bb4 -r 07421c4e0312 scripts/plot/__plt__.m --- 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