diff scripts/plot/stem.m @ 16751:92811d110839

Update copies consistent subset of {x,y,z}data to children of the stem hggoup. (Bug # 39234) * scripts/plot/stem.m: Add demo. * scripts/plot/private/__stem__.m: When a listener triggers an update copy {x,y,z}data(1:M,1:N) to the hggroup's children, where M/N are the minimum number of rows/columns among the matrices, {x,y,z}data.
author Ben Abbott <bpabbott@mac.com>
date Wed, 12 Jun 2013 20:06:18 +0800
parents f3d52523cde1
children 64e7bb01fce2
line wrap: on
line diff
--- a/scripts/plot/stem.m
+++ b/scripts/plot/stem.m
@@ -130,3 +130,15 @@
 %! set (h(2), 'color', 'g');
 %! set (h(1), 'basevalue', -1);
 
+%!demo
+%! clf;
+%! N = 11;
+%! x = 0:(N-1);
+%! y = rand (1, N);
+%! hs = stem (x(1), y(1));
+%! set (gca (), 'xlim', [1, N-1], 'ylim', [0, 1]);
+%! for k=2:N
+%!   set (hs, 'xdata', x(1:k), 'ydata', y(1:k))
+%!   drawnow ();
+%!   pause (0.2);
+%! end