# HG changeset patch # User Ben Abbott # Date 1374184553 14400 # Node ID 84db9338c448ff777691c8214d38b166f035ee23 # Parent b3d4edc991c0feb7770803d2850b588adbcdcd8e Modify copyobj() demo to close non-responsive figure window. script/plot/copyobj.m: Add try/catch block to close non-responsive figure window. diff -r b3d4edc991c0 -r 84db9338c448 scripts/plot/copyobj.m --- a/scripts/plot/copyobj.m Thu Jul 18 12:37:40 2013 -0700 +++ b/scripts/plot/copyobj.m Thu Jul 18 17:55:53 2013 -0400 @@ -86,24 +86,28 @@ %!demo %! ## FIXME: This demo fails occasionally for an obscure reason. %! ## It appears that there is something wrong with Octave code for patches. -%! hdl = figure (1234); -%! clf; -%! subplot (2,2,1); -%! hold on; -%! contourf (rand (10, 10)); -%! colorbar; -%! subplot (2,2,2); -%! quiver (rand (10, 10), rand (10, 10)); -%! subplot (2,2,3); -%! colormap (jet (64)); -%! hold on; -%! sombrero; -%! colorbar ('peer', gca, 'NorthOutside'); -%! subplot (2,2,4); -%! imagesc (rand (30, 30)); -%! text (15, 15, 'Rotated text', ... -%! 'HorizontAlalignment', 'Center', 'Rotation', 30); -%! hnew = copyobj (hdl); +%! try +%! hdl = figure (1234); +%! clf; +%! subplot (2,2,1); +%! hold on; +%! contourf (rand (10, 10)); +%! colorbar; +%! subplot (2,2,2); +%! quiver (rand (10, 10), rand (10, 10)); +%! subplot (2,2,3); +%! colormap (jet (64)); +%! hold on; +%! sombrero; +%! colorbar ('peer', gca, 'NorthOutside'); +%! subplot (2,2,4); +%! imagesc (rand (30, 30)); +%! text (15, 15, 'Rotated text', ... +%! 'HorizontAlalignment', 'Center', 'Rotation', 30); +%! hnew = copyobj (hdl); +%! catch +%! close all +%! end %!testif HAVE_MAGICK %! h1 = figure ();