clear all;

[year Pen Rub Sac] = textread('Maple_Trees_Array.txt', '%s%d%d%d', 'headerlines', 1);
A = [Pen Rub Sac];
xcells = {'Pensylvanicum', 'Rubrum', 'Saccharum'};

x = [1 1 1] * A
y = A * [1; 1; 1]
z = x * [1; 1; 1]

figure(1);
bar(1:3,diag(x),'stacked');
set(gca, 'XTick', 1:3, 'XTickLabel', xcells, 'FontSize', 24);
xlabel({'','Species'});
ylabel({'Number of Trees',''});
title('Figure 3.1');
set(gca,'FontSize',24);

figure(2);
p = pie(x);
xlabel({'','Species'});
legend(xcells);
title('Figure 3.1');
set(gca,'FontSize',24);
t = p(2:2:end);
t(:).FontSize = 24;

'Overall %'
100*A/z

'Col %'
100*A*diag(x)^-1

'Row %'
100*diag(y)^-1*A


