set terminal postscript eps color enhanced font "Helvetica,16pt" size 8cm,6cm set output "g2X_compare.eps" # raw data mercury_data="cross_g2_mercury.dat" RGG_data="cross_g2_RGG.dat" # plot data of gaussian fit by python scripts mercury_fit="g2X_fitted_Hg.dat" RGG_fit="g2X_fitted_RGG.dat" symbols_color = "#008000" set multiplot # mercury top plot, rgg bottom plot # time_offset = 160 #bin number # bin_size = 2 #ns # Mercury fitted values from: g2_fit_report_Hg.txt tau_c = 0.41013377# +/- 0.03423110 (8.35%) (init = 0.3) c = 13196.16 # (fixed) A = 2309.11674 # +/- 142.642957 (6.18%) (init = 2106.84) # inverse c, for g2 = 1 to sync both y axes mercury_normalisation = 7.577962064180994e-05 mercury_normalisation_cross = 7.784299004740641e-05 delay_mercury = 10.3 # fit equation for two g2 side peaks for hg lamp g2_exp(x) = c + A/4 * exp(-abs(2*(x+delay_mercury)/tau_c)) + A/4 * exp(-abs(2*(x-delay_mercury)/tau_c)) set samples 10000 # g2 scale mercury_lower_yrange = 0.97 mercury_higher_yrange = 1.07 # coincidences scale mercury_lower_y2range = 0.001*mercury_lower_yrange/mercury_normalisation_cross mercury_higher_y2range = 0.001*mercury_higher_yrange/mercury_normalisation_cross # mercury top plot parameters set size 1,0.5 set origin 0,0.5 set xrange [-15:15] # ns set yrange [mercury_lower_yrange:mercury_higher_yrange] set ytics nomirror set bars large set ylabel "g^{(2X)}({/Symbol t})" set xlabel "coincidence timing separation {/Symbol t} (ns)" set ytics 0.9,0.02,1.20 format "%.2f" set mytics 2 set y2tics nomirror 10,0.5,16 format "%.1f" set y2label "{/Symbol \264}10^{3} coincidences" set y2range [mercury_lower_y2range:mercury_higher_y2range] set label 1 "(a) Hg lamp" at graph 0.2, graph 0.80 plot mercury_data using 1:3:(sqrt($2)/$2*$3) with yerrorbars linestyle 6 ps 0.9 linetype rgb symbols_color notitle, mercury_fit using 1:3 with lines lw 2 linetype rgb "#000000" notitle unset label # to avoid duplicate labels in bottom rgg plot # RGG fitted values from: g2X_fit_report_RGG.txt tau_c_2 = 172.805536 #+/- 0.64314942 (0.37%) (init = 165) c_2 = 11247.6289 #+/- 1.58385592 (0.01%) (init = 11223.42) A_2 = 9286.55871 #+/- 37.0555071 (0.40%) (init = 11223.42)A_dip = 9464.42788 #+/- 74.2781954 (0.78%) (init = 10235.76) tau_c_dip = 149.040284 #+/- 1.68143190 (1.13%) (init = 200) # inverse c_2, for g2 = 1 to sync both y axes RGG_normalisation = 7.693373732507077e-05 RGG_normalisation_cross = 7.693866588627859e-05 delay_RGG = 2.2 #.225 gaussian_2(x) = c_2 + A_2/4 * exp(-((x+delay_RGG)/(0.001*tau_c_2))**2) + A_2/4 * exp(-((x-delay_RGG)/(0.001*tau_c_2))**2) set samples 1000 # central peak w/o dip, scaled to 2x side peaks, same tau_c thermal(x)= 1+0.5*(A_2/c_2)*exp(-((x)/(0.001*tau_c_2))**2) # g2 scale RGG_lower_yrange = 0.95 RGG_higher_yrange = 1.45 # coincidences scale RGG_lower_y2range = 0.001*RGG_lower_yrange/RGG_normalisation_cross RGG_higher_y2range = 0.001*RGG_higher_yrange/RGG_normalisation_cross # RGG bottom plot parameters set size 1,0.5 set origin 0,0 set yrange [RGG_lower_yrange:RGG_higher_yrange] set xrange [-3:3] set ylabel "g^{(2X)}({/Symbol t})" set xlabel "coincidence timing separation {/Symbol t} ({/Symbol m}s)" set ytics 1.0,0.2,1.5 format "%.1f" set mytics 2 set y2tics nomirror 13,2,25 format "%.0f" set y2label "{/Symbol \264}10^{3} coincidences" set y2range [RGG_lower_y2range:RGG_higher_y2range] set label 2 "(b) RGG" at graph 0.2, graph 0.80 plot RGG_data using ((($1)*2-314)/1000):3:(sqrt($2)/$2*$3) with yerrorbars linestyle 6 pointsize 0.9 linetype rgb "#FF0000" notitle, RGG_fit using ($1/1000):($3) with lines lw 2 linetype rgb "#000000" notitle, [-0.5:0.5] thermal(x) with lines dt 2 lw 2 linetype rgb "blue" notitle unset multiplot reset