set terminal postscript eps color enhanced font "Helvetica,16pt" size 8.6cm,6cm #set terminal pngcairo enhanced font "Helvetica,48pt" size 4000,3000 set output "multiplot_g2freespace.eps" set multiplot # common settings set format y "%4g" set format x "%2.0f" set format x2 "%2.3f" set tics scale 1 set tics nomirror set format y2 "%2.1f" set y2r [0.85:1.85] set y2tics 0.5 set ytics 500 set x2r [-0.75:15] set x2tics 20 set border linewidth 1 set bars 0 set x2label "Distance d [m]" # for fit function # col1 time in ns # col2 zero metre smf # col3 2.4 metre with pinhole bb1-e02 # col4 zero metre mmf # col5 10 metre photon lab # col6 zero metre corridor # col7 15 metre corridor # col8 2.4metre with retroreflector N2(x)=a2+b2*((exp(-abs((x-d2)/tc2)))**2) N3(x)=a3+b3*((exp(-abs((x-d3)/tc3)))**2) N4(x)=a4+b4*((exp(-abs((x-d4)/tc4)))**2) N5(x)=a5+b5*((exp(-abs((x-d5)/tc5)))**2) N6(x)=a6+b6*((exp(-abs((x-d6)/tc6)))**2) N7(x)=a7+b7*((exp(-abs((x-d7)/tc7)))**2) # for plotting with reference to fitted timing=zeroes M2(x)=a2+b2*((exp(-abs((x-(d2-d2))/tc2)))**2) M3(x)=a3+b3*((exp(-abs((x-(d2-d3))/tc3)))**2) M4(x)=a4+b4*((exp(-abs((x-(d4-d4))/tc4)))**2) M5(x)=a5+b5*((exp(-abs((x-(d4-d5))/tc5)))**2) M6(x)=a6+b6*((exp(-abs((x-(d6-d6))/tc6)))**2) M7(x)=a7+b7*((exp(-abs((x-(d6-d7))/tc7)))**2) a2=1000 b2=650 tc2=1 d2=-11.5 a3=1000 b3=650 tc3=1 d3=-27 a4=1000 b4=650 tc4=1 d4=-11.5 a5=1000 b5=650 tc5=1 d5=-78 a6=1000 b6=650 tc6=1 d6=-11.5 a7=1000 b7=650 tc7=1 d7=-100 set fit errorvariables set xrange [-199:-1] FIT_LIMIT=1.e-15 FIT_MAXITER=1000 fit N2(x) 'multiplot_g2freespace.txt' using 1:2:(sqrt($2)) via a2,b2,tc2,d2 fit N3(x) 'multiplot_g2freespace.txt' using 1:3:(sqrt($3)) via a3,b3,tc3,d3 fit N4(x) 'multiplot_g2freespace.txt' using 1:4:(sqrt($4)) via a4,b4,tc4,d4 fit N5(x) 'multiplot_g2freespace.txt' using 1:5:(sqrt($5)) via a5,b5,tc5,d5 fit N6(x) 'multiplot_g2freespace.txt' using 1:6:(sqrt($6)) via a6,b6,tc6,d6 fit N7(x) 'multiplot_g2freespace.txt' using 1:7:(sqrt($7)) via a7,b7,tc7,d7 set xrange [-5:100] # top figure set origin 0.01,0.58 set size 1.02,0.42 set samples 1000 set arrow 5 from (d4-d5),1.75*a5 to (d4-d5),1.85*a5 lw 1 lc rgb 'red' filled set arrow 7 from (d6-d7),1.75*a5 to (d6-d7),1.85*a5 lw 1 lc rgb 'blue' filled set arrow 3 from (d2-d3),1.75*a5 to (d2-d3),1.85*a5 lw 1 lc rgb 'purple' filled unset x2tics set x2tics add ("0" 0) set x2tics add ("10.006(1)" 0.15*(d4-d5)) set x2tics add ("13.406(1)" 0.15*(d6-d7)) set x2tics add ("2.341(1)" 0.15*(d2-d3)) unset xtics #set label 3 "d=2.341(1) m" at 100,1500 set yrange [0.85*a3:1.85*a3] set samples 1000 plot 'multiplot_g2freespace.txt' using (d2-$1):2 w l notitle lw 1 lc rgb "black",\ M2(x) w l lw 1 lc rgb "black" notitle, \ 'multiplot_g2freespace.txt' using (d2-$1):3 w l notitle lw 1 lc rgb "purple",\ M3(x) w l lw 1 lc rgb "purple" notitle unset arrow unset x2label unset x2tics unset label 3 unset yrange # bottom figure set origin 0.01,0.0 set size 1.02,0.43 set xtics 20 set tics scale 1 set tics nomirror set xlabel "Photoevent Timing Separation {/Symbol t} [ns]" #set label 7 "d=13.406(1) m" at 100,1500 set yrange [0.85*a7:1.85*a7] set samples 1000 plot 'multiplot_g2freespace.txt' using (d6-$1):6 w l notitle lw 1 lc rgb "black",\ M6(x) w l lw 1 lc rgb "black" notitle, \ 'multiplot_g2freespace.txt' using (d6-$1):7 w l notitle lw 1 lc rgb "blue",\ M7(x) w l lw 1 lc rgb "blue" notitle unset arrow unset xtics unset xlabel unset label 7 unset yrange # middle figure set origin 0.01,0.34 set size 1.02,0.33 set label "Two-Photoevent Coincidences" at -22,-100 rotate by 90 set label "g^{(2)}({/Symbol t})" at 114,1600 rotate by -90 set yrange [0.85*a5:1.85*a5] #set label 5 "d=10.006(1) m" at 100,1500 set samples 1000 plot 'multiplot_g2freespace.txt' using (d4-$1):4 w l notitle lw 1 lc rgb "black",\ M4(x) w l lw 2 lc rgb "black" notitle, \ 'multiplot_g2freespace.txt' using (d4-$1):5 w l notitle lw 1 lc rgb "red",\ M5(x) w l lw 2 lc rgb "red" notitle unset multiplot reset