# HG changeset patch # User jwe # Date 879920764 0 # Node ID 21208b7973327e7caf8809b257bb62019b739344 # Parent f936c7f5074f124e4c0dbb5fe3402192e780f849 [project @ 1997-11-19 06:26:03 by jwe] diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,13 @@ +Wed Nov 19 00:19:18 1997 John W. Eaton + + * image/colormap.m: Initialize __current_color_map__ in global + statement. + * miscellaneous/toc.m: Initialize __tic_toc_timestamp__ in global + statement. + * plot/axis.m: Initialize __current_axis__ in global statement. + * plot/mplot.m, plot/multiplot.m, plot/oneplot.m, plot/subplot.m, + plot/subwindow.m: Initialize __multiplot_mode__ in global statement. + Tue Nov 18 01:35:50 1997 John W. Eaton * time/tic.m: Rename _time_tic_called to __tic_toc_timestamp__. diff --git a/scripts/image/colormap.m b/scripts/image/colormap.m --- a/scripts/image/colormap.m +++ b/scripts/image/colormap.m @@ -35,7 +35,7 @@ function cmap = colormap (map) - global __current_color_map__ + global __current_color_map__ = gray (); if (nargin > 1) usage ("colormap (map)"); @@ -44,7 +44,7 @@ if (nargin == 1) if (isstr (map)) if (strcmp (map, "default")) - __current_color_map__ = gray; + __current_color_map__ = gray (); else error ("invalid argument"); endif @@ -52,9 +52,6 @@ ## Set the new color map __current_color_map__ = map; endif - elseif (! exist ("__current_color_map__")) - ## If global color map doesn't exist, create the default map. - __current_color_map__ = gray; endif ## Return current color map. diff --git a/scripts/miscellaneous/toc.m b/scripts/miscellaneous/toc.m --- a/scripts/miscellaneous/toc.m +++ b/scripts/miscellaneous/toc.m @@ -32,13 +32,13 @@ warning ("toc: ignoring extra arguments"); endif - global __tic_toc_timestamp__; + global __tic_toc_timestamp__ = -1; - if (exist ("__tic_toc_timestamp__")) - secs = etime (clock (), __tic_toc_timestamp__); - else + if (__tic_toc_timestamp__ < 0) warning ("toc called before timer set"); secs = []; + else + secs = etime (clock (), __tic_toc_timestamp__); endif endfunction diff --git a/scripts/plot/axis.m b/scripts/plot/axis.m --- a/scripts/plot/axis.m +++ b/scripts/plot/axis.m @@ -36,11 +36,7 @@ ## This may not be correct if someone has used the gnuplot interface ## directly... - global __current_axis__; - - if (! exist ("__current_axis__")) - __current_axis__ = [-10, 10, -10, 10]; - endif + global __current_axis__ = [-10, 10, -10, 10]; if (nargin > 1) usage ("axis ([xmin, xmax, ymin, ymax, zmin, zmax])"); diff --git a/scripts/plot/mplot.m b/scripts/plot/mplot.m --- a/scripts/plot/mplot.m +++ b/scripts/plot/mplot.m @@ -41,17 +41,13 @@ ## global variables to keep track of multiplot options - global __multiplot_mode__ - global __multiplot_xsize__ - global __multiplot_ysize__ - global __multiplot_xn__ - global __multiplot_yn__ - global __multiplot_xi__ - global __multiplot_yi__ - - if (! exist ("__multiplot_mode__")) - __multiplot_mode__ = 0; - endif + global __multiplot_mode__ = 0; + global __multiplot_xsize__; + global __multiplot_ysize__; + global __multiplot_xn__; + global __multiplot_yn__; + global __multiplot_xi__; + global __multiplot_yi__; gset nologscale; gset nopolar; diff --git a/scripts/plot/multiplot.m b/scripts/plot/multiplot.m --- a/scripts/plot/multiplot.m +++ b/scripts/plot/multiplot.m @@ -40,17 +40,13 @@ ## global variables to keep track of multiplot options - global __multiplot_mode__ - global __multiplot_xsize__ - global __multiplot_ysize__ - global __multiplot_xn__ - global __multiplot_yn__ - global __multiplot_xi__ - global __multiplot_yi__ - - if (! exist ("__multiplot_mode__")) - __multiplot_mode__ = 0; - endif + global __multiplot_mode__ = 0; + global __multiplot_xsize__; + global __multiplot_ysize__; + global __multiplot_xn__; + global __multiplot_yn__; + global __multiplot_xi__; + global __multiplot_yi__; if (nargin != 2) usage ("multiplot (xn, yn)"); diff --git a/scripts/plot/oneplot.m b/scripts/plot/oneplot.m --- a/scripts/plot/oneplot.m +++ b/scripts/plot/oneplot.m @@ -33,11 +33,7 @@ if (gnuplot_has_multiplot) - global __multiplot_mode__ - - if (! exist ("__multiplot_mode__")) - __multiplot_mode__ = 0; - endif + global __multiplot_mode__ = 0; if (__multiplot_mode__) gset nomultiplot; diff --git a/scripts/plot/subplot.m b/scripts/plot/subplot.m --- a/scripts/plot/subplot.m +++ b/scripts/plot/subplot.m @@ -64,17 +64,13 @@ ## global variables to keep track of multiplot options - global __multiplot_mode__ - global __multiplot_xsize__ - global __multiplot_ysize__ - global __multiplot_xn__ - global __multiplot_yn__ - global __multiplot_xi__ - global __multiplot_yi__ - - if (! exist ("__multiplot_mode__")) - __multiplot_mode__ = 0; - endif + global __multiplot_mode__ = 0; + global __multiplot_xsize__; + global __multiplot_ysize__; + global __multiplot_xn__; + global __multiplot_yn__; + global __multiplot_xi__; + global __multiplot_yi__; if (nargin != 3 && nargin != 1) usage ("subplot (rows, columns, index) or subplot (rcn)"); diff --git a/scripts/plot/subwindow.m b/scripts/plot/subwindow.m --- a/scripts/plot/subwindow.m +++ b/scripts/plot/subwindow.m @@ -38,15 +38,11 @@ ## global variables to keep track of multiplot options - global __multiplot_mode__ - global __multiplot_xsize__ - global __multiplot_ysize__ - global __multiplot_xn__ - global __multiplot_yn__ - - if (! exist ("__multiplot_mode__")) - __multiplot_mode__ = 0; - endif + global __multiplot_mode__ = 0; + global __multiplot_xsize__; + global __multiplot_ysize__; + global __multiplot_xn__; + global __multiplot_yn__; ## check calling argument count