#!/usr/bin/gnuplot #infile1 = 'tmp_ratio_31_03_2017' infile1 = 'ratio_2017_04_19' set terminal postscript eps color enhanced solid font "Helvetica,20" size 8.6cm,11cm #set term pdf #set term pngcairo set output "ratio.eps" lam1 = 0.06 lam2 = 0.054 eff1 = 1 eff2 = eff1 corr = 1.05357*1.1454 #efficiency correction #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) E1(x) = sqrt(x) E2(x) = sqrt(1-x) T1(x) = ( E1(x) - 2*lam1*E1(x) - 2*lam2*E2(x)*sqrt(lam1/lam2) )**2 T2(x) = ( E2(x) - 2*lam1*E1(x)*sqrt(lam2/lam1) - 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) ################################# ####### ####GENERAL SETTINGS#### set border linewidth 1.5 set samples 5000 set multiplot set bar 2 #unset bar unset key set style fill solid 0.3 noborder set lmargin at screen 0.17 set rmargin at screen 0.9 blue_defined = '#0078FF' ########################### ##### ##### #RED set tmargin at screen 0.40 set bmargin at screen 0.12 #set title "" unset xlabel unset ylabel set xlabel "Relative beam power, r" set xlabel "Fractional power in path 1 (%)" set key right bottom set pointsize 1.3 set xrange [0:100] set yrange [55:85] set ytics 10 nomirror set xtics 20 nomirror plot \ infile1 u (100*$2/(($1*corr)+$2)):($8*100):($9*100) w ye lc rgb 'black' pt 7 lw 2 not, \ tx_sum(x/100)*100 lc rgb 'black' lw 2 not #BI unset xtics unset xlabel unset ylabel set border 14 set yrange [25:88] set ytics 20 nomirror set tmargin at screen 0.98 set bmargin at screen 0.70 plot \ infile1 u (100*$2/(($1*corr)+$2)):($4*100):($5*100) w ye lc rgb blue_defined pt 7 lw 2 not, \ tx2(x/100)*100 lc rgb blue_defined lw 2 not #Blue set border 14 set tmargin at screen 0.70 set bmargin at screen 0.40 set ylabel 'Transmission (%)' set yrange [25:88] set ytics 20 nomirror plot \ infile1 u (100*$2/(($1*corr)+$2)):($6*100):($7*100) w ye lc rgb 'red' pt 7 lw 2 not, \ tx1(x/100)*100 lc rgb 'red' lw 2 not unset multiplot unset output pause -1