set terminal postscript eps color enhanced font "Helvetica,16pt" size 8.6cm,6cm set output "apd_mpd_twomodels.eps" #set multiplot ##for the main apd_mpd plot #set size 1,1 #set origin 0,0 #single Lorentzian model tj=.040; ampl1=60 lorentz(t)=ampl1*tj/2/pi/(((tj/2)**2)+(t**2)) fit [-.05:.050] [:] lorentz(x) "apd_mpd.dat" using 1:3:(sqrt($3+1)) via ampl1,tj # exponential decay ampl2=20.7; t2=.380 lg2(x)=ampl2*4/t2*exp(-2*abs(x)/t2) # sum of both lg3(x)=lg2(x)+lorentz(x) # Gaussian ampl3=19.9; t3=0.0109 ga(t)=ampl3*exp(-(t/2/t3)**2)/sqrt(2*pi*(t3**2)) lg4(x)=ga(x)+lg2(x) fit [-1.00:1.000] [:] lg4(x) "apd_mpd.dat" using 1:3:(sqrt($3+1)) via ampl2, ampl3, t3, t2 set logscale y set xr [-1.000:1.000] set yr [1:1500] set xl "Timing Separation {/Symbol t} [ns]" set xtics 0.5 # set ytics 200 # set tics scale 2 set yl "Coincidence Events" set xl offset 0,0.3 set yl offset 1.2,0 set format x "%2.1f" set format y "%g" unset key set label 2 "Gaussian" at 0.15,1.5 tc rgb 'blue' set arrow 2 from .41,1.2 to .07,1.2 filled lc rgb 'blue' front set label 3 "exponential" at .4,80 tc rgb 'blue' set arrow 3 from 0.63,60 to 0.29,60 filled lc rgb 'blue' front set label 4 "combined E + G" at 0.2, 200 tc rgb 'blue' set arrow 4 from 0.4,150 to 0.06,150 filled lc rgb 'blue' front set label 5 "Lorentzian" at 0.4,4 tc rgb 'black' front set arrow 5 from 0.64,5 to 0.3,5 filled lc 0 front set arrow 6 from 0.2,500 to 0.04,500 filled lc rgb 'black' set arrow 7 from -0.2,500 to -0.04,500 filled lc rgb 'black' set label 7 "FWHM: 40ps" at 0.25,500 tc rgb 'black' #plot "apd_mpd.dat" using 1:3 w l lt 1 lc 1 lw 2, \ lorentz(x) lt 1 lc 0 lw 1, \ lg2(x) lt 1 lc rgb 'blue' lw 1, \ lg3(x) lt 1 lc rgb 'green' lw 1 # to force a 2:1 weight ratio for exponential to gaussian #ampl2=26 #ampl3=13 set samples 1000 plot "apd_mpd.dat" using 1:3 w l lt 1 lc 1 lw 2, \ lg2(x) lt 2 lc rgb 'blue' lw 2, \ ga(x) lt 2 lc rgb 'blue' lw 2, \ lg4(x) lt 1 lc rgb 'blue' lw 2, \ lorentz(x) lt 2 lc 0 lw 2 ##for the spdc inset #set size 0.5,0.5 #set origin 0,0 #plot "spdc.png" binary filetype=auto with rgbimage #unset multiplot