thetas = [-45:5:45];
ez_data = load('grating_Ez_d3.5_h1.9_g0.7.dat');
hz_data = load('grating_Hz_d3.5_h1.9_g0.7.dat');

plot(thetas,ez_data(:,2),'ro-');
hold on;
plot(thetas,hz_data(:,2),'gs-');
plot(thetas,ez_data(:,1),'bo-');
plot(thetas,hz_data(:,1),'ms-');
axis([-50 50 0 1]);
set(gca, 'xtick', [-50:10:50]);
set(gca, 'ytick', [0:0.2:1.0]);
legend("transmittance (Ez)","transmittance (Hz)","reflectance (Ez)","reflectance (Hz)");
xlabel("angle of incidence (degrees)");
ylabel("total reflectance/transmittance @ &#955; = 0.5 &#956;m");
