set terminal postscript eps color enhanced font "Helvetica,20pt" size 12cm,9cm set output "g2_arclaser_4b.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 5 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 # 200 = times 5 b=200 # 177 tc=500 # 24 - times 10 B(x)=g*(exp(-abs((2*x)/jc*1000))) g=130 # 132 jc=400 # 0.31 - 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:35] # 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:35] set yrange [0:2*a*5] set samples 10000 set label 1 "wideband (blackbody) response" at 8,1450 tc rgb 'blue' set arrow 1 from 7,1450 to 2,1450 filled lc rgb 'blue' front set label 2 "narrowband (laser) response" at 13,1300 tc rgb 'blue' set arrow 3 from 12,1290 to 9,1215 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 6.25,850 lc rgb 'black' filled plot 'g2_arclaser.txt' using 1:($2):(sqrt($2)) w yerrorbars lc rgb 'red' 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 rgbcolor 'red' ps 1 notitle,\ M(x) w l ls -1 lw 2 notitle