# HG changeset patch # User Ben Abbott # Date 1223314661 14400 # Node ID c83510fbcbe1e01fd1332a8a0af42a99239c26b9 # Parent 277218396978303b29d49502590d507afd47dc9f Remove reliance on ishandle(vec) == false. diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,10 @@ +2008-09-24 Ben Abbott + + * plot/orient.m: Fig handle must be scalar. + * plot/hold.m: Axis handle must be scalar. + * plot/axes.m: Axis handle must be scalar. + * plot/__plt_get_axis_arg__.m: Handle must be scalar. + 2008-10-02 John W. Eaton * pkg/pkg.m (configure_make): Handle filenames with spaces. 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)) tmp = varargin{1}; obj = get (tmp); if (strcmp (obj.type, "axes") || strcmp (obj.type, "hggroup")) diff --git a/scripts/plot/axes.m b/scripts/plot/axes.m --- a/scripts/plot/axes.m +++ b/scripts/plot/axes.m @@ -43,12 +43,12 @@ ## arg is axes handle, make it the current axes for the current ## figure. tmp = varargin{1}; - if (ishandle (tmp) && strcmp (get (tmp, "type"), "axes")) + if (length(tmp) == 1 && ishandle (tmp) && strcmp (get (tmp, "type"), "axes")) parent = ancestor (tmp, "figure"); set (0, "currentfigure", parent); set (parent, "currentaxes", tmp); else - error ("axes: expecting argument to be axes handle"); + error ("axes: expecting argument to be a scalar axes handle"); endif endif diff --git a/scripts/plot/hold.m b/scripts/plot/hold.m --- a/scripts/plot/hold.m +++ b/scripts/plot/hold.m @@ -44,8 +44,10 @@ function hold (varargin) - if (nargin > 0 && ishandle (varargin{1})) + if (nargin > 0 && numel (varargin{1}) == 1 && ishandle (varargin{1}(1))) [h, varargin, nargs] = __plt_get_axis_arg__ ("hold", varargin{:}); + elseif (nargin > 0 && numel (varargin{1}) > 1 && ishandle (varargin{1}(1))) + error ('Invalid input or option') else h = gcf (); nargs = numel (varargin); diff --git a/scripts/plot/orient.m b/scripts/plot/orient.m --- a/scripts/plot/orient.m +++ b/scripts/plot/orient.m @@ -32,7 +32,7 @@ nargs = nargin; - if (nargs > 0 && ishandle (varargin{1})) + if (nargs > 0 && numel (varargin{1}) == 1 && ishandle (varargin{1})) cf = varargin{1}; varargin(1) = []; nargs--;