MATLAB Examples

alt_5d.m

Apply jitter.

load iris

jit = 0.03;

size0 = PetalLength.*PetalWidth;
elongation = PetalLength./PetalWidth;

index = Variety==1;
size1 = size0(index);
elongation1 = elongation(index);
index = Variety==2;
size2 = size0(index);
elongation2 = elongation(index);
index = Variety==3;
size3 = size0(index);
elongation3 = elongation(index);


hg = plot((size1),jitter(log2(elongation1),jit),'x',...
   (size2),jitter(log2(elongation2),jit),'o',...
   (size3),jitter(log2(elongation3),jit),'+');
xlabel('Petal Area ( cm^2)')
ylabel('Jittered Petal Elongation (log2 ratio)')
title('Iris')
legend(hg,char(VarietyName),1)