changeset 8424:a84d71abdc5b

grid.m: handle minor grid option
author Doug Stewart <dastew@sympatico.ca>
date Wed, 24 Dec 2008 16:45:11 -0500
parents 869e4213d5d9
children 2e777f5135a3
files scripts/ChangeLog scripts/plot/grid.m
diffstat 2 files changed, 20 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Wed Dec 24 15:42:45 2008 -0500
+++ b/scripts/ChangeLog	Wed Dec 24 16:45:11 2008 -0500
@@ -1,3 +1,7 @@
+2008-12-24  Doug Stewart  <dastew@sympatico.ca>
+
+	* plot/grid.m: Handle "minor" option.
+
 2008-12-24  John W. Eaton  <jwe@octave.org>
 
 	* testfun/test.m: Print "has no tests" message if there are demos
--- a/scripts/plot/grid.m	Wed Dec 24 15:42:45 2008 -0500
+++ b/scripts/plot/grid.m	Wed Dec 24 16:45:11 2008 -0500
@@ -42,7 +42,7 @@
 
   [ax, varargin, nargs] = __plt_get_axis_arg__ ("grid", varargin{:});
 
-  if (nargs > 1)
+  if (nargs > 2)
     print_usage ();
   elseif (nargs == 0)
     grid_on = ! grid_on;
@@ -54,9 +54,21 @@
       elseif (strcmpi (x, "on"))
 	grid_on = true;
       elseif (strcmpi (x, "minor"))
-	minor_on = ! minor_on;
-	if (minor_on)
-	  grid_on = true;
+        if (nargs == 2)
+	  x2 = varargin{2};
+	  if (strcmpi (x2, "on"))
+	    minor_on = true;
+	    grid_on=true;
+	    elseif (strcmpi (x2, "off"))
+	      minor_on = false;
+	   else
+	      print_usage ();
+	  endif
+	else
+	   minor_on = ! minor_on
+	   if (minor_on)
+	     grid_on = true;
+	   endif
 	endif
       else
 	print_usage ();