plotbyfactor.m 300 B

1234567891011121314151617
  1. function plotbyfactor(x,y,f)
  2. %
  3. % very simplistic version of plotbyfactor.
  4. % no symbols, will crash if more than 8 levels.
  5. %
  6. z = unique(f);
  7. cols = ['b','r','g','m','c','y','k','w'];
  8. for (i = 1:length(z))
  9. u = find(f==z(i));
  10. plot(x(u),y(u),'.','color',cols(i));
  11. hold on;
  12. end;
  13. hold off;
  14. return;