[Changeset]: Re: cla() ?
Michael Goffioul
michael.goffioul at gmail.com
Tue Oct 7 03:16:18 CDT 2008
On Mon, Oct 6, 2008 at 8:02 PM, John W. Eaton <jwe at bevo.che.wisc.edu> wrote:
> | diff --git a/scripts/plot/__plt_get_axis_arg__.m b/scripts/plot/__plt_get_axis_arg__.m
> | --- a/scripts/plot/__plt_get_axis_arg__.m
> | +++ b/scripts/plot/__plt_get_axis_arg__.m
> | @@ -32,8 +32,8 @@
> |
> | ## Figure handles are integers, but object handles are non integer,
> | ## therefore ignore integer scalars.
> | - if (nargin > 1 && length (varargin) > 0 && ishandle (varargin{1})
> | - && floor(varargin{1}) != varargin{1})
> | + if (nargin > 1 && length (varargin) > 0 && numel(varargin{1}) == 1 && ishandle (varargin{1}(1))
> | + && floor(varargin{1}(1)) != varargin{1}(1))
>
> I think a test like
>
> floor(varargin{1}(1)) != varargin{1}(1))
>
> depends too much on the current implementation of figure handles.
> Maybe it would be better to use "! isfigure (varargin{1}(1))" instead?
Testing the handle value is definitely NOT the way to go to check
for a figure, given the fact that when IntegerHandle is off, the figure
handle won't be integer anymore. The safest way is simply to check
the Type property of the graphics object (as isfigure does).
Michael.
More information about the Octave-maintainers
mailing list