Mercurial > hg > octave-terminal
changeset 11919:66881d20101d release-3-0-x
grid.m: handle minor grid option
author | Doug Stewart <dastew@sympatico.ca> |
---|---|
date | Fri, 16 Jan 2009 07:27:19 +0100 |
parents | f2af2233ce7f |
children | 7118a78a4378 |
files | scripts/ChangeLog scripts/plot/grid.m |
diffstat | 2 files changed, 21 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2008-12-24 Doug Stewart <dastew@sympatico.ca> + + * plot/grid.m: Handle "minor" option. + 2008-03-04 Ben Abbott <bpabbott@mac.com> * polynomial/polyfit.m: Modified tests to respect a relative tolerance.
--- a/scripts/plot/grid.m +++ b/scripts/plot/grid.m @@ -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,10 +54,22 @@ elseif (strcmp ("on", x)) grid_on = true; elseif (strcmp ("minor", x)) - minor_on = ! minor_on; - if (minor_on) - grid_on = true; - endif + 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 (); endif