# HG changeset patch # User John W. Eaton # Date 1224513720 14400 # Node ID 1e1e88bcc733f7069f8fbd88556a0a476e26ca5b # Parent 5cfeb7bc497a663a3321b15c0055e16f95dc5606 surfnorm.m: save and restore hold state diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,9 @@ +2008-10-20 John W. Eaton + + * plot/surfnorm.m: Save and restore hold state. + From Daniel J. Sebald and + Ben Abbott . + 2008-10-20 Ben Abbott * plot/__stem__.m: Respect new ordering of children when setting diff --git a/scripts/plot/surfnorm.m b/scripts/plot/surfnorm.m --- 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