set terminal postscript eps color enhanced font "Helvetica,16pt" size 8.6cm,6cm set output "mpd.eps" set xr [-1.5:1.5] set yr [1:1050] set xl "Photoevent Separation {/Symbol t} [ns]" set xtics 0.5 set yl "Two-Photon Coincidences" set format x "%2.1f" #to plot in linear for normal viewing set format y "%g" set ytics 100 #to plot in log scale to appreciate the long tails #set log y 10 #set format y "10^{%T}" #lorentzian fit function L(x)=scale*((1/pi)*(0.5*fwhm)/((x**2)+(0.5*fwhm)**2)) pi=3.14159 scale=50 fwhm=0.04 #gaussian fit function G(x)=a*(exp(-(x**2)/(2*sigma**2)))/(sigma*(2*pi)**0.5) a=60 sigma=0.3 M(x)=L(x)+G(x) #set fit errorvariables FIT_LIMIT=1.e-15 FIT_MAXITER=1000 fit M(x) 'apd_mpd.dat' using 1:3 via scale,fwhm,a,sigma set samples 1000 plot "apd_mpd.dat" using 1:3 w l lt 1 lc 1 lw 2 notitle,\ M(x) w l lt 1 lc -1 lw 3 notitle #results # combined fit of lorentzian + gaussian # lorentzian component fwhm = 36.2 +/- 0.1 picoseconds # gaussian component fwhm = 664 +/- 4 picoseconds, sigma = 283 +/-2 ps # # scale/weights of components # lorentzian-to-gaussian = 51 to 62