Mercurial > hg > octave-lojdl
changeset 8240:5cfeb7bc497a
comet.m,hold.m: validate axes handle
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Mon, 20 Oct 2008 10:31:17 -0400 |
parents | 041bb0c64f07 |
children | 1e1e88bcc733 |
files | scripts/ChangeLog scripts/plot/comet.m scripts/plot/hold.m |
diffstat | 3 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -5,6 +5,8 @@ * plot/orient.m, plot/print.m: Properly validate figure handle. + * plot/hold.m, plot/comet.m: Properly validate axes handle. + 2008-10-20 David Bateman <dbateman@free.fr> * plot/plotyy.m: Test that an axes handle actually is one before
--- a/scripts/plot/comet.m +++ b/scripts/plot/comet.m @@ -40,7 +40,8 @@ if (nargin == 0) print_usage (); - elseif (numel (varargin{1}) == 1 && ishandle (varargin{1})) + elseif (numel (varargin{1}) == 1 && ishandle (varargin{1}) + && strcmpi (get (varargin{1}, "type"), "axes")) axes (varargin{1}); varargin = varargin(2:end); numargin = nargin - 1;
--- a/scripts/plot/hold.m +++ b/scripts/plot/hold.m @@ -44,7 +44,8 @@ function hold (varargin) - if (nargin > 0 && numel (varargin{1}) == 1 && ishandle (varargin{1}(1))) + if (nargin > 0 && numel (varargin{1}) == 1 && ishandle (varargin{1}(1)) + && strcmp (get (varargin{1}, "type"), "axes")) [h, varargin, nargs] = __plt_get_axis_arg__ ("hold", varargin{:}); elseif (nargin > 0 && numel (varargin{1}) > 1 && ishandle (varargin{1}(1))) print_usage ();