Mercurial > hg > octave-lojdl
changeset 8065:6333da0dfdfd
hold.m: if hold is applied to a figure, set state for all child axes objects
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 26 Aug 2008 18:05:13 -0400 |
parents | 4f1ebb704545 |
children | 366821c0c01c |
files | scripts/ChangeLog scripts/plot/hold.m |
diffstat | 2 files changed, 16 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2008-08-26 John W. Eaton <jwe@octave.org> + + * plot/hold.m: If hold is applied to a figure, set state for all + child axes objects. + 2008-08-26 Michael Goffioul <michael.goffioul@gmail.com> * plot/backend.m: New function to handle backend switch.
--- a/scripts/plot/hold.m +++ b/scripts/plot/hold.m @@ -44,12 +44,15 @@ function hold (varargin) - [h, varargin] = __plt_get_axis_arg__ ("hold", varargin{:}); + if (nargin > 0 && ishandle (varargin{1})) + [h, varargin, nargs] = __plt_get_axis_arg__ ("hold", varargin{:}); + else + h = gcf (); + nargs = numel (varargin); + endif hold_state = get (h, "nextplot"); - nargs = numel (varargin); - if (nargs == 0) if (strcmp (hold_state, "add")) hold_state = "replace"; @@ -71,6 +74,11 @@ print_usage (); endif + if (isfigure (h)) + axes_objs = findobj (h, "type", "axes"); + h = [h; axes_objs]; + endif + set (h, "nextplot", hold_state); endfunction