diff scripts/plot/legend.m @ 9457:f9fb8c1a8e45

legend.m: Add an hggroup demo using bar(). Include clf() in each demo.
author Ben Abbott <bpabbott@mac.com>
date Thu, 23 Jul 2009 18:04:49 -0400
parents 350148cc0774
children 95c3e38098bf
line wrap: on
line diff
--- a/scripts/plot/legend.m	Thu Jul 23 16:19:20 2009 -0400
+++ b/scripts/plot/legend.m	Thu Jul 23 18:04:49 2009 -0400
@@ -262,7 +262,7 @@
 %! legend("boxon")
 
 %!demo
-%! hold ("off");
+%! clf
 %! x = linspace (0, 10);
 %! plot (x, x);
 %! hold ("on");
@@ -271,11 +271,25 @@
 %! hold ("off");
 
 %!demo
+%! clf
 %! x = linspace (0, 10);
 %! plot (x, x, x, x.^2);
 %! legend ("linear");
 
 %!demo
+%! clf
 %! x = linspace (0, 10);
 %! plot (x, x, x, x.^2);
 %! legend ("linear", "quadratic");
+
+%!demo
+%! clf
+%! bar (rand (2, 3))
+%! ylim ([0 1.2])
+%! legend ({"1st Bar", "2nd Bar", "3rd Bar"})
+
+%!demo
+%! clf
+%! bar (rand (2, 3))
+%! ylim ([0 1.2])
+%! legend ("1st Bar", "2nd Bar", "3rd Bar")