% plc.m

y = [rand(10,1)*0.2 rand(10,1)*0.2 rand(10,1)*0.2;
     rand(10,1)*0.2+0.7 rand(10,1)*0.2+0.6 rand(10,1)*0.2+0.7];

%plot3(y(:,1), y(:,2), y(:,3), '+');

cols = 'rygb'; ncol = max(size(cols));

clg;
axis([0 1 0 1 0 1]);
hold on;

cla;

N = 20; left = 1; dk = 7; icol = 1;
while left <= N,
  head = plot3(0,0,0,sprintf('%c+',cols(icol)),'EraseMode','xor');  
  right = left + dk - 1;  right = min(right,N);
  set(head, 'xdata', y(left:right,1), 'ydata', y(left:right,2), ...
            'zdata', y(left:right,3));
  set(head, 'EraseMode', 'none');
  drawnow;
  left = right+1;
  icol = rem(icol,ncol) + 1;
end;
hold off;