set terminal postscript eps color enhanced font "Helvetica,20pt" size 12cm,9cm set output "g2_arclaser_4a.eps" set multiplot set origin 0,0 set size 1,1 # common settings set format y "%4g" set format x "%2.0f" set tics scale 2 set tics nomirror set format y2 "%2.1f" set y2r [0:2] set y2tics 0.5 set ytics 500 set xtics 25 set xlabel "Photoevent Separation {/Symbol t} [ns]" set ylabel "Two-Photon Coincidences" set y2label "g^{(2)}({/Symbol t})" rotate by -90 # for fit function L(x)=a*5+b*(exp(-abs((2*x)/tc*10))) a=200 # 191 = times 5 b=200 # 195 tc=500 # 49 - times 10 B(x)=g*(exp(-abs((2*x)/jc*1000))) g=130 # 125 jc=400 # 0.39 - times 1000 C(x)=2*((b*g)**0.5)*(exp(-abs((x)/tc*10)-abs((x)/jc*1000))) N(x)=L(x)+B(x)+C(x) set fit errorvariables set xrange [-2:96] # FIT_LIMIT=1.e-15 # FIT_MAXITER=100 fit N(x) 'g2_arclaser.txt' using 1:2:(sqrt($2)) via a,b,tc,g,jc set xrange [-2:96] set yrange [0:2*a*5] set samples 10000 set label 1 "wideband (blackbody) response" at 13,1450 tc rgb 'blue' set arrow 1 from 12,1450 to 2,1450 filled lc rgb 'blue' front set label 2 "narrowband (laser) response" at 35,1250 tc rgb 'blue' set arrow 3 from 33,1240 to 21,1165 filled lc rgb 'blue' front set object 1 rectangle from -1,a*5 to 1, 1.8*a*5 set arrow 4 from 0,940 to 8,800 lc rgb 'black' filled plot 'g2_arclaser.txt' using 1:($2):(sqrt($2)) w yerrorbars lc 1 ps 1 notitle,\ N(x) w l ls -1 lw 2 notitle # small inset M(x)=L(x)+B(x)+C(x) set fit errorvariables set yrange [a*5:1.8*a*5] set xrange [-2.5:2.5] FIT_LIMIT=1.e-15 FIT_MAXITER=100 # fit M(x) 'g2_arclaser.txt' using 1:2:(sqrt($2)) via a,b,tc,g,jc set origin .15,.11 set size .4,.4 unset label 1 unset label 2 unset arrow 1 unset arrow 3 unset object 1 unset arrow 4 set xrange [-1.5:1.5] #set yrange [a:1.8*a] set y2r [1:1.8] set y2tics 0.2 unset xlabel unset ylabel unset y2label set xtics 1 set format y "" plot 'g2_arclaser.txt' using 1:($2):(sqrt($2)) \ w yerrorbars lc 1 ps 1 notitle,\ M(x) w l ls -1 lw 2 notitle