Gnuplot - 拟合

Gnuplot - fitting

请问装修有什么问题?

A = -100
C = -0.3
D = 22
f(x) = A*sin(2*pi*x+C)+D
fit f(x) 'RV_phase' via A,C,D
g(x) = -100*sin(2*pi*x-0.3)+22

plot 'RV_phase' u 3:2 with points pt 7 ps 1 notitle, f(x) lc rgb "black" title "Fitted", g(x) lc rgb "red" title "Manual setting"

手动设置曲线是否足够?

对于拟合,您必须使用 using 指定相同的数据列,就像您在绘图时使用的那样:

fit f(x) 'RV_phase' using 3:2 via A,C,D 
plot 'RV_phase' using 3:2 with points, f(x) with lines