#!/usr/bin/gnuplot #infile1 = 'tmp_ratio_31_03_2017' infile1 = 'ratio_2017_04_19' set terminal postscript eps color enhanced solid font "Helvetica,24" size 12cm,10cm #set term pdf #set term pngcairo set output "ratio.eps" #set title "" set xlabel "Relative beam power, r" set ylabel 'Transmission (%)' set key right bottom set pointsize 2 unset bar set xrange [-0.985:0.985] set yrange [25:85] set ytics 10 nomirror set xtics 0.3 nomirror lam1 = 0.054 lam2 = 0.06 eff1 = 1 eff2 = eff1 E1(x) = sqrt((1+x)/2) * sqrt(eff1) E2(x) = sqrt((1-x)/2) * sqrt(eff2) T1(x) = ( E1(x) - 2*lam1*E1(x) - 2*lam2*E2(x) )**2 T2(x) = ( E2(x) - 2*lam1*E1(x) - 2*lam2*E2(x) )**2 tx1(x) = T1(x) / E1(x)**2 tx2(x) = T2(x) / E2(x)**2 tx_sum(x) = (T1(x) + T2(x)) / (E1(x)**2 + E2(x)**2) plot \ infile1 u 3:($4*100):($5*100) w ye lc rgb 'blue' lt 7 not, \ infile1 u 3:($6*100):($7*100) w ye lc rgb 'red' lt 7 not, \ infile1 u 3:($8*100):($9*100) w ye lc rgb 'black' lt 7 not, \ tx1(x)*100 lc rgb 'blue' lw 2 not, \ tx2(x)*100 lc rgb 'red' lw 2 not, \ tx_sum(x)*100 lc rgb 'black' lw 2 not unset output pause -1