Mercurial > hg > octave-lyh
diff scripts/plot/surfnorm.m @ 8241:1e1e88bcc733
surfnorm.m: save and restore hold state
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 20 Oct 2008 10:42:00 -0400 |
parents | 5389a52df87b |
children | a013ff655ca4 |
line wrap: on
line diff
--- a/scripts/plot/surfnorm.m +++ b/scripts/plot/surfnorm.m @@ -114,11 +114,16 @@ axes (h); newplot (); surf (x, y, z, varargin{ioff:end}); - hold on; - plot3 ([x(:)'; x(:).' + nx(:).' ; NaN(size(x(:).'))](:), - [y(:)'; y(:).' + ny(:).' ; NaN(size(y(:).'))](:), - [z(:)'; z(:).' + nz(:).' ; NaN(size(z(:).'))](:), - varargin{ioff:end}); + old_hold_state = get (h, "nextplot"); + unwind_protect + set (h, "nextplot", "add"); + plot3 ([x(:)'; x(:).' + nx(:).' ; NaN(size(x(:).'))](:), + [y(:)'; y(:).' + ny(:).' ; NaN(size(y(:).'))](:), + [z(:)'; z(:).' + nz(:).' ; NaN(size(z(:).'))](:), + varargin{ioff:end}); + unwind_protect_cleanup + set (h, "nextplot", old_hold_state); + end_unwind_protect unwind_protect_cleanup axes (oldh); end_unwind_protect