I would like to know how I can add 2 seperate functions of 2 different plots to form the fit for the 3rd one?
I am using Gnuplot 4.6.3.
So, I have the following functions: f(x)=a+bx, g(x)=c+dx.
Now the third plot is the total of the first and the second plot added together. So, how can I add the fits together and plot it to form the fitting of the third one?
What I have tried so far:
gnuplot> f(x)=a+b*x
gnuplot> g(x)=c+d*x
gnuplot> fit [:] [:] f(x) 'filename1.dat' u 1:(log(-$2)) via a,b
gnuplot> fir [:] [:] g(x) 'filename2.dat' u 1:(log(-$2)) via c,d
I get results for the variables a,b,c,d.
gnuplot> plot 'filename1.dat', f(x) via a,b
gnuplot> replot 'filename2.dat', g(x) via c,d
gnuplot> replot 'filename1+2.dat', f(x)+g(x)
The 3rd fit is completely off, so I know I did something wrong, but what?
Thank you!