1 ## Copyright (C) 1996-2012 John W. Eaton
3 ## This file is part of Octave.
5 ## Octave is free software; you can redistribute it and/or modify it
6 ## under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 3 of the License, or (at
8 ## your option) any later version.
10 ## Octave is distributed in the hope that it will be useful, but
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 ## General Public License for more details.
15 ## You should have received a copy of the GNU General Public License
16 ## along with Octave; see the file COPYING. If not, see
17 ## <http://www.gnu.org/licenses/>.
20 ## @deftypefn {Function File} {[@var{h}, @var{varargin}, @var{narg}] =} __plt_get_axis_arg__ (@var{caller}, @var{varargin})
21 ## Undocumented internal function.
26 function [h, varargin, narg] = __plt_get_axis_arg__ (caller, varargin)
28 if (islogical (caller))
36 ## Figure handles are integers, but object handles are non-integer,
37 ## therefore ignore integer scalars.
38 if (nargin > 1 && length (varargin) > 0 && isnumeric (varargin{1})
39 && numel (varargin{1}) == 1 && ishandle (varargin{1}(1))
40 && varargin{1}(1) != 0 && ! isfigure (varargin{1}(1)))
43 if ((strcmp (obj.type, "axes") && ! strcmp (obj.tag, "legend"))
44 || strcmp (obj.type, "hggroup"))
45 h = ancestor (tmp, "axes");
47 if (isempty (varargin))
51 error ("%s: expecting first argument to be axes handle", caller);
54 f = get (0, "currentfigure");
58 h = get (f, "currentaxes");
72 if (ishandle (h) && strcmp (get (h, "nextplot"), "new"))
76 narg = length (varargin);
81 ## No test needed for internal helper function.