# HG changeset patch # User John W. Eaton # Date 1219788313 14400 # Node ID 965bb17961f060622e607c6eaeaba1f813aede3d # Parent 8f28953882c25efddc38d11609fd392781bfb205 hold.m: if hold is applied to a figure, set state for all child axes objects diff -r 8f28953882c2 -r 965bb17961f0 scripts/ChangeLog --- a/scripts/ChangeLog Fri Aug 22 14:42:12 2008 -0400 +++ b/scripts/ChangeLog Tue Aug 26 18:05:13 2008 -0400 @@ -1,3 +1,8 @@ +2008-08-26 John W. Eaton + + * plot/hold.m: If hold is applied to a figure, set state for all + child axes objects. + 2008-08-22 John W. Eaton * statistics/distributions/chi2rnd.m: Fix missing semicolon. diff -r 8f28953882c2 -r 965bb17961f0 scripts/plot/hold.m --- a/scripts/plot/hold.m Fri Aug 22 14:42:12 2008 -0400 +++ b/scripts/plot/hold.m Tue Aug 26 18:05:13 2008 -0400 @@ -38,12 +38,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"; @@ -65,6 +68,11 @@ print_usage (); endif + if (isfigure (h)) + axes_objs = findobj (h, "type", "axes"); + h = [h; axes_objs]; + endif + set (h, "nextplot", hold_state); endfunction