1

I was looking for a function in gnuplot to set the name of the file with the fit data. The file 'fit.log'. I know there is something about "set fit logfile 'myfit.log'" but i am not able to set the name of the file.. It always create the file fit.log. Any ideas?

    f(x)=a*x+b
    fit f(x) 'data.dat' u 2:1 via a,b 
    set fit logfile 'myfit.log'

1 Answers1

0

You simply have to specify the fit output filename before the fit itself:

f(x)=a*x+b
set fit logfile 'myfit.log'
fit f(x) 'data.dat' u 2:1 via a,b 

There are more fit parameters to set (check help set fit). Of course, you you have to set them all before the fit.

theozh
  • 22,244
  • 5
  • 28
  • 72
  • Ok thank you a lot, i´ll try this. But maybe i´ve asked the question wrong. I used gnuplot there with scripts and the terminal cairolatex. when i write "set fit logfile 'myfit.log'" after i close the cairolatex terminal it works. Anyway i´ve got the the result that i want. But i´ll check yours! thank you buddy! – bettercallluca May 25 '21 at 07:20