%get pre R2014b colours
co = [0,0,1;
0,0.5,0;
1,0,0;
0,0.75,0.75;
0.75,0,0.75;
0,0,0;];
set(groot,'defaultAxesColorOrder',co);
% Get data from http://physics.nist.gov/cgi-bin/Xcom/xcom2
%Photon Coherent Incoher. Photoel. Nuclear Electron Tot. w/
%Energy Scatter. Scatter. Absorb. Pr. Prd. Pr. Prd. Coherent
XCOM_Fe = {...
1.000E-03 4.54E+00 8.78E-03 9.08E+03 0.00E+00 0.00E+00 9.09E+03;...
1.500E-03 4.24E+00 1.53E-02 3.40E+03 0.00E+00 0.00E+00 3.40E+03;...
2.000E-03 3.93E+00 2.12E-02 1.62E+03 0.00E+00 0.00E+00 1.63E+03;...
3.000E-03 3.35E+00 3.21E-02 5.54E+02 0.00E+00 0.00E+00 5.58E+02;...
4.000E-03 2.85E+00 4.21E-02 2.54E+02 0.00E+00 0.00E+00 2.57E+02;...
5.000E-03 2.42E+00 5.13E-02 1.37E+02 0.00E+00 0.00E+00 1.40E+02;...
6.000E-03 2.06E+00 5.97E-02 8.27E+01 0.00E+00 0.00E+00 8.48E+01;...
7.112E-03 1.74E+00 6.80E-02 5.14E+01 0.00E+00 0.00E+00 5.32E+01;...
7.112E-03 1.74E+00 6.80E-02 4.06E+02 0.00E+00 0.00E+00 4.08E+02;...
8.000E-03 1.54E+00 7.40E-02 3.04E+02 0.00E+00 0.00E+00 3.06E+02;...
1.000E-02 1.20E+00 8.54E-02 1.69E+02 0.00E+00 0.00E+00 1.71E+02;...
1.500E-02 7.46E-01 1.05E-01 5.62E+01 0.00E+00 0.00E+00 5.71E+01;...
2.000E-02 5.17E-01 1.16E-01 2.50E+01 0.00E+00 0.00E+00 2.57E+01;...
3.000E-02 2.85E-01 1.29E-01 7.76E+00 0.00E+00 0.00E+00 8.18E+00;...
4.000E-02 1.80E-01 1.34E-01 3.32E+00 0.00E+00 0.00E+00 3.63E+00;...
5.000E-02 1.24E-01 1.36E-01 1.70E+00 0.00E+00 0.00E+00 1.96E+00;...
6.000E-02 9.18E-02 1.36E-01 9.78E-01 0.00E+00 0.00E+00 1.20E+00;...
8.000E-02 5.60E-02 1.33E-01 4.06E-01 0.00E+00 0.00E+00 5.95E-01;...
1.000E-01 3.77E-02 1.30E-01 2.04E-01 0.00E+00 0.00E+00 3.72E-01;...
1.500E-01 1.78E-02 1.20E-01 5.86E-02 0.00E+00 0.00E+00 1.96E-01;...
2.000E-01 1.03E-02 1.11E-01 2.43E-02 0.00E+00 0.00E+00 1.46E-01;...
3.000E-01 4.73E-03 9.79E-02 7.27E-03 0.00E+00 0.00E+00 1.10E-01;...
4.000E-01 2.69E-03 8.81E-02 3.21E-03 0.00E+00 0.00E+00 9.40E-02;...
5.000E-01 1.74E-03 8.06E-02 1.76E-03 0.00E+00 0.00E+00 8.41E-02;...
6.000E-01 1.21E-03 7.47E-02 1.11E-03 0.00E+00 0.00E+00 7.70E-02;...
8.000E-01 6.83E-04 6.57E-02 5.65E-04 0.00E+00 0.00E+00 6.70E-02;...
1.000E+00 4.38E-04 5.92E-02 3.51E-04 0.00E+00 0.00E+00 5.99E-02;...
1.022E+00 4.20E-04 5.85E-02 3.34E-04 0.00E+00 0.00E+00 5.93E-02;...
1.250E+00 2.81E-04 5.29E-02 2.26E-04 7.03E-05 0.00E+00 5.35E-02;...
1.500E+00 1.95E-04 4.81E-02 1.63E-04 3.58E-04 0.00E+00 4.88E-02;...
2.000E+00 1.10E-04 4.11E-02 1.00E-04 1.36E-03 0.00E+00 4.26E-02;...
2.044E+00 1.05E-04 4.06E-02 9.69E-05 1.47E-03 0.00E+00 4.22E-02;...
3.000E+00 4.88E-05 3.23E-02 5.45E-05 3.78E-03 1.13E-05 3.62E-02;...
4.000E+00 2.75E-05 2.70E-02 3.67E-05 6.04E-03 4.62E-05 3.31E-02;...
5.000E+00 1.76E-05 2.33E-02 2.75E-05 8.03E-03 9.20E-05 3.15E-02;...
6.000E+00 1.22E-05 2.06E-02 2.19E-05 9.81E-03 1.41E-04 3.06E-02;...
7.000E+00 8.97E-06 1.85E-02 1.81E-05 1.14E-02 1.90E-04 3.01E-02;...
8.000E+00 6.87E-06 1.68E-02 1.55E-05 1.28E-02 2.38E-04 2.99E-02;...
9.000E+00 5.43E-06 1.55E-02 1.35E-05 1.41E-02 2.84E-04 2.99E-02;...
1.000E+01 4.40E-06 1.43E-02 1.20E-05 1.53E-02 3.27E-04 2.99E-02;...
1.100E+01 3.63E-06 1.34E-02 1.07E-05 1.63E-02 3.68E-04 3.01E-02;...
1.200E+01 3.05E-06 1.25E-02 9.73E-06 1.73E-02 4.07E-04 3.02E-02;...
1.300E+01 2.60E-06 1.18E-02 8.89E-06 1.82E-02 4.44E-04 3.04E-02;...
1.400E+01 2.24E-06 1.12E-02 8.19E-06 1.90E-02 4.78E-04 3.07E-02;...
1.500E+01 1.95E-06 1.06E-02 7.59E-06 1.98E-02 5.11E-04 3.09E-02;...
1.600E+01 1.72E-06 1.01E-02 7.07E-06 2.05E-02 5.43E-04 3.12E-02;...
1.800E+01 1.36E-06 9.24E-03 6.22E-06 2.19E-02 6.01E-04 3.17E-02;...
2.000E+01 1.10E-06 8.52E-03 5.55E-06 2.31E-02 6.55E-04 3.22E-02;...
2.200E+01 9.08E-07 7.91E-03 5.02E-06 2.41E-02 7.04E-04 3.28E-02;...
2.400E+01 7.63E-07 7.40E-03 4.57E-06 2.51E-02 7.49E-04 3.33E-02;...
2.600E+01 6.50E-07 6.94E-03 4.20E-06 2.60E-02 7.90E-04 3.38E-02;...
2.800E+01 5.61E-07 6.55E-03 3.88E-06 2.69E-02 8.29E-04 3.42E-02;...
3.000E+01 4.89E-07 6.20E-03 3.61E-06 2.76E-02 8.65E-04 3.47E-02;...
4.000E+01 2.75E-07 4.93E-03 2.67E-06 3.07E-02 1.02E-03 3.67E-02;...
5.000E+01 1.76E-07 4.11E-03 2.12E-06 3.30E-02 1.13E-03 3.83E-02;...
6.000E+01 1.22E-07 3.54E-03 1.76E-06 3.48E-02 1.22E-03 3.96E-02;...
8.000E+01 6.87E-08 2.80E-03 1.31E-06 3.76E-02 1.37E-03 4.17E-02;...
1.000E+02 4.40E-08 2.32E-03 1.04E-06 3.95E-02 1.47E-03 4.33E-02;...
1.500E+02 1.95E-08 1.65E-03 6.93E-07 4.26E-02 1.64E-03 4.59E-02;...
2.000E+02 1.10E-08 1.30E-03 5.18E-07 4.45E-02 1.75E-03 4.76E-02;...
3.000E+02 4.88E-09 9.18E-04 3.45E-07 4.67E-02 1.89E-03 4.95E-02;...
4.000E+02 2.75E-09 7.19E-04 2.58E-07 4.80E-02 1.97E-03 5.07E-02;...
5.000E+02 1.76E-09 5.95E-04 2.06E-07 4.88E-02 2.03E-03 5.15E-02;...
6.000E+02 1.22E-09 5.10E-04 1.72E-07 4.94E-02 2.07E-03 5.20E-02;...
8.000E+02 6.87E-10 3.98E-04 1.29E-07 5.03E-02 2.13E-03 5.28E-02;...
1.000E+03 4.40E-10 3.27E-04 1.03E-07 5.08E-02 2.17E-03 5.33E-02;...
1.500E+03 1.95E-10 2.29E-04 6.86E-08 5.15E-02 2.23E-03 5.40E-02;...
2.000E+03 1.10E-10 1.77E-04 5.14E-08 5.19E-02 2.26E-03 5.44E-02;...
3.000E+03 4.88E-11 1.23E-04 3.43E-08 5.24E-02 2.30E-03 5.48E-02;...
4.000E+03 2.75E-11 9.50E-05 2.57E-08 5.26E-02 2.32E-03 5.50E-02;...
5.000E+03 1.76E-11 7.77E-05 2.06E-08 5.28E-02 2.33E-03 5.52E-02;...
6.000E+03 1.22E-11 6.59E-05 1.71E-08 5.29E-02 2.34E-03 5.53E-02;...
8.000E+03 6.87E-12 5.08E-05 1.29E-08 5.30E-02 2.36E-03 5.54E-02;...
1.000E+04 4.40E-12 4.14E-05 1.03E-08 5.31E-02 2.36E-03 5.55E-02;...
1.500E+04 1.95E-12 2.86E-05 6.85E-09 5.32E-02 2.38E-03 5.57E-02;...
2.000E+04 1.10E-12 2.20E-05 5.14E-09 5.33E-02 2.38E-03 5.57E-02;...
3.000E+04 4.88E-13 1.52E-05 3.43E-09 5.34E-02 2.39E-03 5.58E-02;...
4.000E+04 2.75E-13 1.17E-05 2.57E-09 5.34E-02 2.39E-03 5.58E-02;...
5.000E+04 1.76E-13 9.49E-06 2.06E-09 5.34E-02 2.39E-03 5.58E-02;...
6.000E+04 1.22E-13 8.02E-06 1.71E-09 5.35E-02 2.40E-03 5.59E-02;...
8.000E+04 6.87E-14 6.15E-06 1.29E-09 5.35E-02 2.40E-03 5.59E-02;...
1.000E+05 4.40E-14 5.01E-06 1.03E-09 5.35E-02 2.40E-03 5.59E-02};
XCOM_Fe = cell2mat(XCOM_Fe);
%% Plot data
X = XCOM_Fe(:,1);
Y = XCOM_Fe(:,2:end);
loglog(X,Y,'LineWidth',2);
grid on;
legend({'Coherent Scattering','Incoherent Scattering','Photoelectric Absorption',...
'Pair Production In Nuclear Field', 'Pair Production In Electron Field', 'Total Attenuation'});
xlabel('Energy (MeV)');
ylabel('Attenuation (cm^{2}/g)');
xlim([min(X) max(X)]);
ylim([1e-4 1e4]);
title('Photon Mass Attenuation Coefficients for Iron');
% perform additional hand adjustments of image size
plot2svg('iron.svg')