reset set terminal postscript eps color enhanced solid font "Helvetica,16" size 9cm, 5.5cm set output 'plot.eps' set sample 1000,1000 f(x)=(x>=1?bg+((a1**2)*exp(-2*(x-x0)/t1))+((a2**2)*exp(-2*(x-x0)/t2))+(2*a1*a2*exp(-(x-x0)*((1/t1)+(1/t2)))*cos((2*3.14*0.266*(x-x0))+p)):1) x0=-1;a1=300;a2=300;t1=10.2;t2=25.5;p=0.6;bg=3 set xlabel font "Helvetica,18" "ti-ts (ns)" set ylabel font "Helvetica,18" "Counts in 5 hours" fit [-1:] f(x) 'out1.dat' u 1:2 via a1,a2,p plot [-10:50] 'out1.dat' every 4 u 1:2:(sqrt($2))w yerrorbars notitle pt 7 ps 0.5,f(x) w l lc rgb "black" lw 2 lt 1 notitle