changeset 3106:21208b797332

[project @ 1997-11-19 06:26:03 by jwe]
author jwe
date Wed, 19 Nov 1997 06:26:04 +0000
parents f936c7f5074f
children a8dcfbf87ea3
files scripts/ChangeLog scripts/image/colormap.m scripts/miscellaneous/toc.m scripts/plot/axis.m scripts/plot/mplot.m scripts/plot/multiplot.m scripts/plot/oneplot.m scripts/plot/subplot.m scripts/plot/subwindow.m
diffstat 9 files changed, 44 insertions(+), 61 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Wed Nov 19 04:37:56 1997 +0000
+++ b/scripts/ChangeLog	Wed Nov 19 06:26:04 1997 +0000
@@ -1,3 +1,13 @@
+Wed Nov 19 00:19:18 1997  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* 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  <jwe@bevo.che.wisc.edu>
 
 	* time/tic.m: Rename _time_tic_called to __tic_toc_timestamp__.
--- a/scripts/image/colormap.m	Wed Nov 19 04:37:56 1997 +0000
+++ b/scripts/image/colormap.m	Wed Nov 19 06:26:04 1997 +0000
@@ -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.
--- a/scripts/miscellaneous/toc.m	Wed Nov 19 04:37:56 1997 +0000
+++ b/scripts/miscellaneous/toc.m	Wed Nov 19 06:26:04 1997 +0000
@@ -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
--- a/scripts/plot/axis.m	Wed Nov 19 04:37:56 1997 +0000
+++ b/scripts/plot/axis.m	Wed Nov 19 06:26:04 1997 +0000
@@ -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])");
--- a/scripts/plot/mplot.m	Wed Nov 19 04:37:56 1997 +0000
+++ b/scripts/plot/mplot.m	Wed Nov 19 06:26:04 1997 +0000
@@ -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;
--- a/scripts/plot/multiplot.m	Wed Nov 19 04:37:56 1997 +0000
+++ b/scripts/plot/multiplot.m	Wed Nov 19 06:26:04 1997 +0000
@@ -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)");
--- a/scripts/plot/oneplot.m	Wed Nov 19 04:37:56 1997 +0000
+++ b/scripts/plot/oneplot.m	Wed Nov 19 06:26:04 1997 +0000
@@ -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;
--- a/scripts/plot/subplot.m	Wed Nov 19 04:37:56 1997 +0000
+++ b/scripts/plot/subplot.m	Wed Nov 19 06:26:04 1997 +0000
@@ -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)");
--- a/scripts/plot/subwindow.m	Wed Nov 19 04:37:56 1997 +0000
+++ b/scripts/plot/subwindow.m	Wed Nov 19 06:26:04 1997 +0000
@@ -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