# HG changeset patch # User Rik # Date 1374732766 25200 # Node ID cec8c423b3e8f3c533a0450b57fe347b60a37494 # Parent f4dc32d6f2631b09a097028c191d1e41dc8634cf __axes_limits__.m: Overhaul to use new __plt_get_axis_arg__. * scripts/plot/private/__axes_limits__.m: Use hax instead of h. Use gca if hax is not set. diff -r f4dc32d6f263 -r cec8c423b3e8 scripts/plot/private/__axes_limits__.m --- a/scripts/plot/private/__axes_limits__.m Wed Jul 24 23:12:46 2013 -0700 +++ b/scripts/plot/private/__axes_limits__.m Wed Jul 24 23:12:46 2013 -0700 @@ -27,18 +27,22 @@ fcnmode = sprintf ("%smode", fcn); - [h, varargin, nargin] = __plt_get_axis_arg__ (fcn, varargin{:}); + [hax, varargin, nargin] = __plt_get_axis_arg__ (fcn, varargin{:}); + + if (isempty (hax)) + hax = gca (); + endif if (nargin == 0) - retval = get (h, fcn); + retval = get (hax, fcn); else arg = varargin{1}; if (ischar (arg)) if (strcmpi (arg, "mode")) - retval = get (h, fcnmode); - elseif (strcmpi (arg, "auto") || strcmpi (arg, "manual")) - set (h, fcnmode, arg); + retval = get (hax, fcnmode); + elseif (strcmpi (arg, "auto") || strcmpi (arg, "manual")) + set (hax, fcnmode, arg); endif else if (!isnumeric (arg) && any (size (arg(:)) != [2, 1])) @@ -47,7 +51,7 @@ if (arg(1) >= arg(2)) error ("%s: axis limits must be increasing", fcn); else - set (h, fcn, arg(:)); + set (hax, fcn, arg(:)); endif endif endif