diff scripts/plot/grid.m @ 4:b4df021f796c

[project @ 1993-08-08 01:26:08 by jwe] Initial revision
author jwe
date Sun, 08 Aug 1993 01:26:08 +0000
parents
children 16a24e76d6e0
line wrap: on
line diff
new file mode 100644
--- /dev/null
+++ b/scripts/plot/grid.m
@@ -0,0 +1,30 @@
+function grid (x)
+
+# usage: grid ("on" | "off")
+#
+# Turn grid lines on or off for plotting.
+#
+# If the argument is omitted, "on" is assumed.
+#
+# See also: plot, semilogx, semilogy, loglog, polar, mesh, contour,
+#           bar, stairs, gplot, gsplot, replot, xlabel, ylabel, title 
+
+  if (nargin == 0)
+    set grid;
+  elseif (nargin == 1)
+    if (isstr (x))
+      if (strcmp ("off", x))
+        set nogrid;
+      elseif (strcmp ("on", x))
+        set grid;
+      else
+        error ("usage: grid (\"on\" | \"off\")");
+      endif
+    else
+      error ("error: grid: argument must be a string");
+    endif
+  else
+    error ("usage: grid (\"on\" | \"off\")");
+  endif
+
+endfunction