I want to do the following in gnuplot: read my files, which are conveniently labeled "filenameN.txt", where N is the Nth file.
Fit some polynom fN(x)to the data, using aN, bN,... and plot all of those in a single graphic (multiple plots) using multiplot
However, I cannot get this to work using the loops available in gnuplot. What does work is for example creating one file, that does what I want for N, and then running an external loop that passes N=1...M.
This results in M plots, but not in a single multiplot.
For this to work I need to assign variables with variable names (f1, f2, ... a1, a2, ..., ...) for the fits (since I potentially want to use all of them together somehow)
I also want the plot loop to produce simple plots in a multiplot (each containing data and its fit, M times, not a multiplot where the first plot contains all of the lines, and the rest of the plots are empty.
So I have two questions then:
- How to assign variable variable-names
- How to use loops in a multiplot layout