MATLAB Examples

alt_6d.m

Make a traditional plot to demonstrate obscurity.

load barley

% Organize yield into arrays by variety and site
%  specific to this data arrangement.
nSite = length(SiteName);
nVariety = length(VarietyName);
Site = Site(1:nSite);
ncol = length(Yield)/nSite;
Variety = reshape(Variety,nSite,ncol);
Year = reshape(Year,nSite,ncol);
Yield = reshape(Yield,nSite,ncol);
Variety = Variety(1,1:nVariety);
Year = [Year(1,1) Year(1,end)];
Yield1 = Yield(:,1:nVariety);
Yield2 = Yield(:,nVariety+1:end);

for iPlot = 1:nSite
    subplot(3,2,iPlot)
    thisYield1 = Yield1(iPlot,:)';
    thisYield2 = Yield2(iPlot,:)';
    bar([thisYield1 thisYield2],1)
    set(gca,'XLim',[0 nVariety+1],'XTickLabel',[])
    title(SiteName{Site(iPlot)})
end
colormap(hot)