set terminal postscript eps color enhanced font "Helvetica,16pt" size 8.6cm,6cm # common settings set format y "%4g" set format x "%2.1f" # set tics scale 2 set tics nomirror set format y2 "%2.1f" set y2r [0:2] set y2tics 0.5 set ytics 1000 set xlabel "Photoevent Separation {/Symbol t} [ns]" set ylabel "Two-Photon Coincidences" set y2label "g^{(2)}({/Symbol t})" rotate by -90 # for fit function N(x)=a+b*((exp(-abs((x-d)/tc)))**2) M(x)=a+b*((exp(-abs((x/(10**9))/tc)))**2) a=1400 b=1400 tc=0.0000000004 d=-0.000000003817 set fit errorvariables set xrange [-0.00000000688:-0.00000000052] FIT_LIMIT=1.e-15 FIT_MAXITER=1000 fit N(x) 'g2sun.txt' using 1:2:(sqrt($2)) via a,b,tc,d set output "g2sun.eps" set xrange [-2:2] set yrange [0:2*a] set samples 1000 plot 'g2sun.txt' using ($1-d)*10**9:2:(sqrt($2)) w yerrorbars notitle,\ M(x) w l ls -1 notitle