set terminal postscript eps color enhanced font "Helvetica,16pt" size 8.6cm,5.5cm #set terminal pngcairo enhanced font "Helvetica,24pt" size 1920,1080 set output "1550nm.eps" #set output "1550nm.png" # common settings set format y "%2.1f" set format x "%2.0f" set tics scale 1 set tics nomirror set ytics 0.1 set xtics 10 set yrange [0:70000] set xr [251-20:251+20] #nanoseconds set border linewidth 1 set samples 10000 set ylabel "g^(^2^)({/Symbol t})" set xlabel "Timing separation {/Symbol t} (ns)" #for g2 fit function g(x)=f+b*(exp(-abs((x-d)/tauc))**2) f = 20000 #floor b = 4000 #bunching peak minus floor at x=251ns d = 251 #delay x=251ns for peak position tauc = 2 #coherence time set fit errorvariables FIT_LIMIT=1.e-15 FIT_MAXITER=1000 fit g(x) "1550nm_2emitter.g2" using 1:2:(sqrt($2)) yerror via f,b,d,tauc normg(x)=1+(b/f)*(exp(-abs((x)/tauc))**2) set yrange [0.9:1.5] #to rescale for plotting normalised g2 set xrange [-30:30] set samples 10000 plot '1550nm_1emitter.g2' using ($1-d):($2/36315):(sqrt($2)/36315) w yerrorbars linestyle 7 lw 4 ps 0.5 lc rgb "black" notitle, '1550nm_2emitter.g2' using ($1-d):($2/20882):(sqrt($2)/20882) w yerrorbars linestyle 7 lw 4 ps 0.5 lc rgb "blue" notitle, normg(x) w l lw 2 lc rgb "black" notitle reset