Mercurial > hg > octave-lojdl
changeset 17046:cec8c423b3e8
__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.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 24 Jul 2013 23:12:46 -0700 |
parents | f4dc32d6f263 |
children | 6dec8dbf8a97 |
files | scripts/plot/private/__axes_limits__.m |
diffstat | 1 files changed, 10 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/plot/private/__axes_limits__.m +++ b/scripts/plot/private/__axes_limits__.m @@ -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