I have some code in a Gnuplot file that does curve fitting, currently to a line:
f(x) = m * x + b
fit f(x) "data.txt" using "Days":"Data" via m, b
This works great, but the data looks like it will fit a log curve better. So I tried the following:
f(x) = b + m * log(x)
fit f(x) "data.txt" using "Days":"Data" via m, b
This results in the following error:
line 46: unknown type in real()
What am I doing wrong?
fitworks, but ifxever goes negative,log(x)becomes a complex number, whichfitmay not be prepared to deal with (assuminggnuplotslog()implementation even works for negative numbers, instead of returning a "domain error" or other similar condition)...fit a*x+b "data" using (log($1)):2 via a,bor something like that. Show your data if you want better help figuring out the actual problem here.