I have an issue with gnuplot. I do need to fit two data files (say file1 and file 2) that have 51 columns. I do it in a loop like this
do for [j=2:51] {
fxj(x) = Dxj*x+ qxj
fit [xmin:xmax] fxj(x) '< paste file1 file2' u 1:(((column(j))+(column(j+51)))/2) via Dxj, qxj
print j, ' ', Dxj/2
}
Everything wonderful. What i do need now is to plot every fxj defined in the loop over the data in order to have the raw data and the fit overlapped.
I tried it like this
do for [j=2:51] {
fxj(x) = Dxj*x+ qxj
fit [xmin:xmax] fxj(x) '< paste file1 file2' u 1:(((column(j))+(column(j+51)))/2) via Dxj, qxj
print j, ' ', Dxj/2
plot '< paste file1 file2' u 1:(((column(j))+(column(j+51)))/2) t'', fxj(x) t''
}
but it doesn't work. Do you have any suggestion to make it work?
