# HG changeset patch # User Rik # Date 1375483034 25200 # Node ID 1748182db4588d8789b71461af38e57686677ea8 # Parent 6a1aa61b5b168a30b43033571dfc789fe60083be __axes_limits__.m: Update code to modern conventions. * scripts/plot/private/__axes_limits__.m: Update code to modern conventions. diff -r 6a1aa61b5b16 -r 1748182db458 scripts/plot/private/__axes_limits__.m --- a/scripts/plot/private/__axes_limits__.m Fri Aug 02 15:12:02 2013 -0700 +++ b/scripts/plot/private/__axes_limits__.m Fri Aug 02 15:37:14 2013 -0700 @@ -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 +