set terminal postscript eps color enhanced font "Helvetica,16pt" size 8cm,6cm set output "g2_compare.eps" # raw data mercury_data="g2_mercury_raw.dat" RGG_data="g2_RGG_raw.dat" # plot data of gaussian fit by python scripts mercury_fit="g2_mercury_fitted.dat" RGG_fit="g2_RGG_fitted.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 python scripts tau_c = 0.20210630 #+/- 0.01141141 (5.65%) (init = 0.3) c = 13308.7015 #+/- 2.17845954 (0.02%) (init = 13591) A = 1872.96008 #+/- 94.3448382 (5.04%) (init = 1712) # inverse c = 13308.7015, for g2 = 1 to sync both y axes mercury_normalisation = 7.577962064180994e-05 gaussian(x) = c + A * exp(-(x/tau_c)**2) set samples 1000 # g2 scale mercury_lower_yrange = 0.95 mercury_higher_yrange = 1.20 # coincidences scale mercury_lower_y2range = 0.001*mercury_lower_yrange/mercury_normalisation mercury_higher_y2range = 0.001*mercury_higher_yrange/mercury_normalisation # mercury top plot parameters set size 1,0.5 set origin 0,0.5 set xrange [-1.5:1.5] set yrange [mercury_lower_yrange:mercury_higher_yrange] set ytics nomirror set bars large set ylabel "g^{(2)}({/Symbol t})" set xlabel "coincidence timing separation {/Symbol t} (ns)" set ytics 1.0,0.1,1.2 format "%.1f" set y2tics nomirror 13,1,15 format "%.0f" set y2label "{/Symbol \264}10^{3} coincidences" set y2range [mercury_lower_y2range:mercury_higher_y2range] set label 1 "(a) Hg lamp" at graph 0.1, 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, gaussian(x)*mercury_normalisation with lines lw 2 linetype rgb "#000000" notitle unset label # to avoid duplicate labels in bottom rgg plot # RGG fitted values from python scripts tau_c_2 = 166.631814 #+/- 0.34943582 (0.21%) (init = 124) c_2 = 10139.4399 #+/- 1.85375085 (0.02%) (init = 10725) A_2 = 8706.68383 #+/- 17.8401695 (0.20%) (init = 8996) # inverse c_2, for g2 = 1 to sync both y axes RGG_normalisation = 9.871213521639057e-05 gaussian_2(x) = c_2 + A_2 * exp(-(x*1000/tau_c_2)**2) set samples 1000 # g2 scale RGG_lower_yrange = 0.9 RGG_higher_yrange = 2.1 # coicidences scale RGG_lower_y2range = 0.001*RGG_lower_yrange/RGG_normalisation RGG_higher_y2range = 0.001*RGG_higher_yrange/RGG_normalisation # RGG bottom plot parameters set size 1,0.5 set origin 0,0 set yrange [RGG_lower_yrange:RGG_higher_yrange] set xrange [-1:1] set ylabel "g^{(2)}({/Symbol t})" set xlabel "coincidence timing separation {/Symbol t} ({/Symbol m}s)" set ytics 1.0,0.5,2.0 format "%.1f" set y2tics nomirror 10,5,20 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.1, graph 0.80 plot RGG_data using ($1/1000):3:(sqrt($2)/$2*$3) with yerrorbars linestyle 6 pointsize 0.9 linetype rgb "#FF0000" notitle, gaussian_2(x)*RGG_normalisation with lines lw 2 linetype rgb "#000000" notitle unset multiplot reset