changeset 17006:84db9338c448

Modify copyobj() demo to close non-responsive figure window. script/plot/copyobj.m: Add try/catch block to close non-responsive figure window.
author Ben Abbott <bpabbott@mac.com>
date Thu, 18 Jul 2013 17:55:53 -0400
parents b3d4edc991c0
children c2e43dd6eb70
files scripts/plot/copyobj.m
diffstat 1 files changed, 22 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- 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 ();