set terminal postscript eps color enhanced font "Helvetica,16pt" size 9cm,10cm #set terminal pngcairo enhanced font "Helvetica,24pt" size 4000,3000 set output "g2lidar2km.eps" #set output "g2lidar2km.png" set multiplot # common settings set format y "%4g" set format y2 "%2.1f" set format x "%2.0f" set format x2 "%2.1f" set tics scale 1 set tics nomirror set y2r [0.9:1.715] set y2tics 0.2 set ytics 2 #set x2tics (0,250,500,750) #set x2tics add (965.4) set xr [0-0.098:14] #microseconds set x2r [0-0.0147:2.1] #kilometres set border linewidth 1 set samples 10000 #top figure set origin 0,0.5 set size 1.0,0.5 set ylabel " " set y2label " " set x2label "Ranging distance (km)" set x2tics 0.5 unset xtics set yrange [0.9*10487*0.001:1.715*10487*0.001] #set label "0.96529(2) km" at 1.8,16.7 # for fit function # M(x) for 1km M(x)=e+f*((exp(-abs((x-h)/tg)))**2) e=10.16 f=6.89 tg=0.022 h=6.44 set fit errorvariables FIT_LIMIT=1.e-15 FIT_MAXITER=1000 set xr [4:8] #microseconds, for fitting 1km near 6.4us fit M(x) 'g2lidarkm.txt' using ($1*0.002-0.098):($3*0.001):(sqrt($3)*0.001) via e,f,tg,h set xr [0-0.098:14] #microseconds, fot plotting plot 'g2lidarkm.txt' using ($1*0.002-0.098):($3*0.001)*1.033:(sqrt($2)) w l notitle lw 1 lc rgb "blue", 'g2lidar2km.txt' using ($1*0.002-0.098):($2*0.001):(sqrt($2)) w l notitle lw 1 lc rgb "black" unset label #bottom figure set origin 0,0 set size 1.0,0.5 #set label "Two-photoevent coincidences ({/Symbol \264}1000)" at -2.5,13 rotate by 90 set label "Two-photoevent coincidences (x 1000)" at -2.5,13 rotate by 90 set label "g^{(2)}({/Symbol t})" at 16.2,19.6 rotate by -90 set xlabel "Time-of-flight {/Symbol t} ({/Symbol m}s)" unset x2label set xtics 2 nomirror unset x2tics set yrange [0.9*10504*0.001:1.715*10504*0.001] plot 'g2lidar2km.txt' using ($1*0.002-0.098):($3*0.001):(sqrt($3)) w l notitle lw 1 lc rgb "red" #inset figure below for 2km set origin 0.2,0.15 set size 0.45,0.3 unset label unset xlabel unset tics set x2r [1.8375:1.86546] #kilometres set yrange [0.9*10504*0.001:1.815*10504*0.001] set format x "%2.3f" set x2tics scale 1 set x2tics ("1.85147(2) km" 1.8515) set bars small set arrow 1 from 12.54,6.4 to 12.54,22 lw 1 lc rgb 'black' dt 2 nohead set arrow 2 from 12.54,22 to 12.58,22 lw 1 lc rgb 'black' dt 2 nohead set arrow 3 from 12.58,22 to 12.58,6.4 lw 1 lc rgb 'black' dt 2 nohead set arrow 4 from 12.58,6.4 to 12.54,6.4 lw 1 lc rgb 'black' dt 2 nohead set arrow 5 from 12.54,6.4 to 12.437,9.4 lw 1 lc rgb 'black' dt 2 nohead set arrow 6 from 12.54,22 to 12.437,19.05 lw 1 lc rgb 'black' dt 2 nohead # for fit function to 2km 12.3us N(x)=a+b*((exp(-abs((x-d)/tc)))**2) a=10.5 b=6.3 tc=0.022 d=12.35 set fit errorvariables FIT_LIMIT=1.e-15 FIT_MAXITER=1000 set xr [10:14] #microseconds, for fitting fit N(x) 'g2lidar2km.txt' using ($1*0.002-0.098):($3*0.001):(sqrt($3)*0.001) via a,b,tc,d set xr [12.25:12.4364] #microseconds, fot plotting plot 'g2lidar2km.txt' using ($1*0.002-0.098):($3*0.001):(sqrt($3)*0.001) w yerrorbars ps 0 lw 1 lc rgb "red" notitle, N(x) w l lc rgb "black" lw 1 notitle #inset figure above for 1km set origin 0.45,0.59 set size 0.45,0.3 unset label unset tics unset arrow set xr [6.34:6.5264] #microseconds set x2r [0.951:0.97896] #kilometres set yrange [0.9*10168*0.001:1.815*10168*0.001] set format x "%2.3f" set x2tics scale 1 set x2tics ("0.96529(2) km" 0.9653) set bars small set arrow 7 from 6.29,5.7 to 6.29,20.5 lw 1 lc rgb 'black' dt 2 nohead set arrow 8 from 6.29,20.5 to 6.33,20.5 lw 1 lc rgb 'black' dt 2 nohead set arrow 9 from 6.33,20.5 to 6.33,5.7 lw 1 lc rgb 'black' dt 2 nohead set arrow 10 from 6.33,5.7 to 6.29,5.7 lw 1 lc rgb 'black' dt 2 nohead set arrow 11 from 6.33,20.5 to 6.34,18.5 lw 1 lc rgb 'black' dt 2 nohead set arrow 12 from 6.33,5.7 to 6.34,9 lw 1 lc rgb 'black' dt 2 nohead plot 'g2lidarkm.txt' using ($1*0.002-0.098):($3*0.001):(sqrt($3)*0.001) w yerrorbars ps 0 lw 1 lc rgb "blue" notitle, M(x) w l lc rgb "black" lw 1 notitle unset arrow unset multiplot reset