I want to do this for a long time but failed all the time. So basically, I built one GNUPLOT script and use sed command to generate new script and run GNUPLOT in BASH. This works well, but it’s tricky to type \” in BASH script which is essential in GNUPLOT script for file name, title or axial name, etc.
I used some time today to figure out how to do this in GNUPLOT. The code is compact and simple. I add an example below, it’s easy to understand. I have 300 files. a_1.dat … a_100.dat, b_1.dat … b_100.dat, c_1.dat … c_100.dat. And I want to generate 100 png figures. Each figure contain a, b, c three plots. I shifted the y axis for b and c to avoid the overlap of three plots. And output file has name file1.png … file100.png.