Mercurial > hg > octave-lyh
changeset 17164:1748182db458
__axes_limits__.m: Update code to modern conventions.
* scripts/plot/private/__axes_limits__.m: Update code to modern conventions.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 02 Aug 2013 15:37:14 -0700 |
parents | 6a1aa61b5b16 |
children | 5fd07aa232cf |
files | scripts/plot/private/__axes_limits__.m |
diffstat | 1 files changed, 5 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/plot/private/__axes_limits__.m +++ b/scripts/plot/private/__axes_limits__.m @@ -23,10 +23,6 @@ function retval = __axes_limits__ (fcn, varargin) - retval = []; - - fcnmode = sprintf ("%smode", fcn); - [hax, varargin, nargin] = __plt_get_axis_arg__ (fcn, varargin{:}); if (isempty (hax)) @@ -36,17 +32,18 @@ if (nargin == 0) retval = get (hax, fcn); else + retval = []; + fcnmode = [fcn "mode"]; arg = varargin{1}; - if (ischar (arg)) if (strcmpi (arg, "mode")) retval = get (hax, fcnmode); - elseif (strcmpi (arg, "auto") || strcmpi (arg, "manual")) + elseif (any (strcmpi (arg, {"auto", "manual"}))) set (hax, fcnmode, arg); endif else if (!isnumeric (arg) && any (size (arg(:)) != [2, 1])) - error ("%s: argument must be a 2 element vector", fcn); + error ("%s: LIMITS must be a 2-element vector", fcn); else if (arg(1) >= arg(2)) error ("%s: axis limits must be increasing", fcn); @@ -58,3 +55,4 @@ endif endfunction +