我需要进行线性近似,但是需要在对数尺度上进行。
这是我的gnuplot脚本:
f(x)= a*x+b
fit f(x) "d0.dat" via a,b
set logscale x
set logscale y
plot "d0.dat" with points lt rgb "#ff0000" title "Points", \
f(x) with lines lt rgb "#ff00ff" title "Approximation"
显然这个近似是错误的。有没有人可以帮我修正它?在谷歌上我没有找到任何信息。