Mercurial > hg > octave-lyh
comparison scripts/plot/hold.m @ 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 | 85c5c1d55820 |
children | a028a5960e18 |
comparison
equal
deleted
inserted
replaced
8064:4f1ebb704545 | 8065:6333da0dfdfd |
---|---|
42 | 42 |
43 ## PKG_ADD: mark_as_command hold | 43 ## PKG_ADD: mark_as_command hold |
44 | 44 |
45 function hold (varargin) | 45 function hold (varargin) |
46 | 46 |
47 [h, varargin] = __plt_get_axis_arg__ ("hold", varargin{:}); | 47 if (nargin > 0 && ishandle (varargin{1})) |
48 [h, varargin, nargs] = __plt_get_axis_arg__ ("hold", varargin{:}); | |
49 else | |
50 h = gcf (); | |
51 nargs = numel (varargin); | |
52 endif | |
48 | 53 |
49 hold_state = get (h, "nextplot"); | 54 hold_state = get (h, "nextplot"); |
50 | |
51 nargs = numel (varargin); | |
52 | 55 |
53 if (nargs == 0) | 56 if (nargs == 0) |
54 if (strcmp (hold_state, "add")) | 57 if (strcmp (hold_state, "add")) |
55 hold_state = "replace"; | 58 hold_state = "replace"; |
56 else | 59 else |
69 endif | 72 endif |
70 else | 73 else |
71 print_usage (); | 74 print_usage (); |
72 endif | 75 endif |
73 | 76 |
77 if (isfigure (h)) | |
78 axes_objs = findobj (h, "type", "axes"); | |
79 h = [h; axes_objs]; | |
80 endif | |
81 | |
74 set (h, "nextplot", hold_state); | 82 set (h, "nextplot", hold_state); |
75 | 83 |
76 endfunction | 84 endfunction |