reset # # fit polynomial to data # f(x) = c0 + c1*sqrt(1-x**2) + 2*c2*(1-x**2) c0 = 1500; c1 = 6000; c2 = -500; FIT_LIMIT = 1e-10 fit f(x) 'ld_19_7_02_1.txt' using 1:3 via c0, c1, c2 # # plot it # set xrange [-1.1:1.1] set yrange [0:1.2] set key 0.1,0.3 set xlabel "r/R" set ylabel "Intensity" set pointsize 1.0 plot "ld_19_7_02_1.txt" \ using 1:($3/f(0)) \ title 'Fit result' \ with points pointtype 7, \ f(x)/f(0) \ title '' with lines linetype 1 # # normalize the parameters # a0 = c0 / f(0) a1 = c1 / f(0) a2 = c2 / f(0) print "parameters a0, a1, a2...", a0, a1, a2