# plot with labels generated using latex # to obtain the final PDF file run in sequence: # gnuplot plot_beat_latex.gnu # latex plot_beat.tex # dvipdf plot_beat.dvi plot_beat.pdf set terminal epslatex 'phv' standalone color colortext 8 size 11cm, 7cm set output 'plot_beat.tex' set border 3 set nobar set size 1,1 set sample 1000,1000 set colors classic # f(x)=(x>=0?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=0;a1=300;a2=300;t1=10.2;t2=26;p=0.1;bg=2 # fit [0:] f(x) 'ff.dat' u 1:2 via a1,a2,p g(x)= g*(2*r*exp(-(x-x0)*(1/(2*t0)+1/(2*t1)))*cos(fr*(x-x0)+p) + exp(-(x-x0)/t0) + r**2*exp(-(x-x0)/t1)) e(x)= g * (2*r*cos(p)+r**2+1) * exp((x-x0)/tr) bg = 2.57542 # Parameters obtained by fit x0 = -0.077944 g = 36.90769 r = .75 p = pi tr = 0.3 t0 = 5.6 t1 = 13.1 fr = 1.671327 set label 'Selected polarizations:' at first 10,105 set label 'signal: $|L\rangle$' at first 10, first 90 set label 'idler: (0.7+0.57i)$|H\rangle$ + 0.41i$|{V}\rangle$' at first 10, first 75 set xlabel '$\Delta$t (ns)' set ylabel 'Coincidence events' set format '%g' set xtics nomirror set ytics nomirror plot [-10:40]'ff.dat' every 2 u 1:2:(sqrt($2))w yerrorbars notitle pt 7 ps 0.5, g(x)*(x>x0) + e(x)*(x