function IntensityGraph;

% A function to print out various graph data

[z,Temp,N2,O2,O,H,M,NO,CO2]=textread('background.txt','%f %f %f %f %f %f %f %f %f','delimiter',',');

I9 = dlmread('I9.txt'); % matrix containing  I98, I97, I96, I95, I94, I9, 
I8 = dlmread('I8.txt'); % matrix containing  I87, I86, I85, I84, I83, I8, 
I7 = dlmread('I7.txt'); % matrix containing  I76, I75, I74, I73, I72, I7, 
I6 = dlmread('I6.txt'); % matrix containing  I65, I64, I63, I62, I61, I6,
I5 = dlmread('I5.txt'); % matrix containing  I54, I53, I52, I51, I50, I5,
I4 = dlmread('I4.txt'); % matrix containing  I43, I42, I41, I40, I4, 
I3 = dlmread('I3.txt'); % matrix containing  I32, I31, I30, I3, 
I2 = dlmread('I2.txt'); % matrix containing  I21, I20, I2, 
I1 = dlmread('I1.txt'); % matrix containing  I10, I1, 

n=1:length(Temp);

I9a=I9(n,6);
I8a=I8(n,6);
I7a=I7(n,6);
I6a=I6(n,6);
I5a=I5(n,6);
I4a=I4(n,5);
I3a=I3(n,4);
I2a=I2(n,3);
I1a=I1(n,2);

plot(I9a,z,'r',I8a,z,'g',I7a,z,'b',I6a,z,'c',I5a,z,'k',I4a,z,'-.r',I3a,z,'-.g',I2a,z,'-.b',I1a,z,'-.c');
xlabel('Intensity (photons cm-3 s-1 sphere-1)');
ylabel('Altitude (km)');
legend('I9','I8','I7','I6','I5','I4','I3','I2','I1',0);