function legTrackerTracePlot(data,range,scaling,spacing) %legTrackerTracePlot creates a figure with the 15 instrument vectors %plotted for a specified range of frames, with the traces nicely staggered %and roughly colored %Usage: %legTrackerTracePlot(data,range,scaling,spacing) %data = Nx15 array of instrument data, where N is an arbitrary number of % frames, and 15 corresponds to the x- and y-coordinates of each leg and the % 3 ball motion vectors. Corresponds to cols [2:13 26:28] of raw instrument % output and cols [1:15] of the .data object in the % legTrackerClassifyRawData output. %range = which frames to plot %scaling = how tall to make the x- and y- coordinate traces relative to the % ball motion vectors %spacing = how much vertical space to place between traces %start figure figure; hold on; %subtract baseline (modal) value from each vector data=data-repmat(mode(data),size(data,1),1); %plot ball motion vectors plot(range,data(range,14)- spacing*-3,'r') plot(range,data(range,13)- spacing*-2,'k') plot(range,data(range,15)- spacing*-1,'g') %plot leg x-components plot(range,data(range,1)*scaling- spacing*1,'k') plot(range,data(range,4)*scaling- spacing*2,'k') plot(range,data(range,5)*scaling- spacing*3,'k') plot(range,data(range,2)*scaling- spacing*4,'k') plot(range,data(range,3)*scaling- spacing*5,'k') plot(range,data(range,6)*scaling- spacing*6,'k') %plot leg y-components plot(range,data(range,7)*scaling- spacing*8,'b') plot(range,data(range,10)*scaling- spacing*9,'b') plot(range,data(range,11)*scaling- spacing*10,'b') plot(range,data(range,8)*scaling- spacing*11,'b') plot(range,data(range,9)*scaling- spacing*12,'b') plot(range,data(range,12)*scaling- spacing*13,'b')