Mercurial > hg > octave-terminal
changeset 8189:8e8afefe9466
Remove reliance on ishandle(vec) == false.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Mon, 06 Oct 2008 20:39:44 -0400 |
parents | 946035db5605 |
children | 73d6b71788c0 |
files | scripts/ChangeLog scripts/plot/__plt_get_axis_arg__.m scripts/plot/axes.m scripts/plot/hold.m scripts/plot/orient.m |
diffstat | 5 files changed, 14 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,5 +1,10 @@ 2008-10-06 Ben Abbott <bpabbott@mac.com> + * plot/orient.m: Figure 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. + * miscellaneous/delete.m: Permit a vector of handles to be deleted. 2008-10-02 John W. Eaton <jwe@octave.org>
--- 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)) && ! isfigure (varargin{1}(1))) tmp = varargin{1}; obj = get (tmp); if (strcmp (obj.type, "axes") || strcmp (obj.type, "hggroup"))
--- a/scripts/plot/axes.m +++ b/scripts/plot/axes.m @@ -43,12 +43,13 @@ ## 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
--- 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))) + print_usage (); else h = gcf (); nargs = numel (varargin);