diff scripts/plot/whitebg.m @ 13096:5553412c6614

Tests for scripts/plot * (allchild.m, ancestor.m, clf.m, findall.m, findobj.m, gcf.m, line.m, view.m, whitebg.m, xlim.m, ylim.m, zlim.m): Add tests
author Kai Habel <kai.habel@gmx.de>
date Sun, 04 Sep 2011 21:58:42 +0200
parents cefd568ea073
children ebb42fb2da04
line wrap: on
line diff
--- a/scripts/plot/whitebg.m
+++ b/scripts/plot/whitebg.m
@@ -143,3 +143,21 @@
     endif
   endif
 endfunction
+
+%!test
+%! set (0, "defaultaxescolor", [1 1 1]);
+%! set (0, "defaultfigurecolor", [1 1 1]);
+%! hf = figure (1232, "visible", "off");
+%! unwind_protect  
+%!   l = line;
+%!   assert (get (hf, "color"), [1 1 1]);
+%!   assert (get (gca, "color"), [1 1 1]);
+%!   whitebg;
+%!   assert (get (hf, "color"), [0 0 0]);
+%!   assert (get (gca, "color"), [0 0 0]);
+%!   whitebg([0.2 0.2 0.2])
+%!   assert (get (hf, "color"), [0 0 0]);
+%!   assert (get (gca, "color"), [0.2 0.2 0.2]);
+%! unwind_protect_cleanup
+%!   close (hf);
+%! end_unwind_protect