- #1
Telemachus
- 835
- 30
Hi there. I am making some numerical tests, and printing the results in a data file. The data file contains the Cartesian coordinates, and the function to be plotted at the x,y point for each time t in columns: x,y,f(x,y). I could add a fourth column for the time step, or equally print each time step in different files. I have already a script for gnuplot to plot in contour diagrams. I would like to extend this script in such a way that it prints a .png file for each time. This could be done just by using a single data file with x,y,f(x,y),t information in columns, or using different data files with the x,y,f(x,y) information for each time as well. The idea is to use a loop file, but I don't know how to do this.
Does anyone here knows how to do this in gnuplot?
I've tried to call to this file:
t = t + 0.1
outfile = sprintf('animation/analytical1%02.0f.png',10*t)
set output outfile
set terminal png size 1024,768
splot ('fort.1%02.0f',10*t)
if(t<end_time) reread;
From this I get all the png files, but it looks like it is not reading the information.
Originally, for a single time I had:
splot 'file.dat' using 1:2:3
But now if I put "using 1:2:3" the script gives me an error.
Edit: Ok. It seems now it works, I added the line:
infile = sprintf('fort.1%02.0f',10*t)
splot infile using 1:2:3
Edit: Fixed. Now it works.
Does anyone here knows how to do this in gnuplot?
I've tried to call to this file:
t = t + 0.1
outfile = sprintf('animation/analytical1%02.0f.png',10*t)
set output outfile
set terminal png size 1024,768
splot ('fort.1%02.0f',10*t)
if(t<end_time) reread;
From this I get all the png files, but it looks like it is not reading the information.
Originally, for a single time I had:
splot 'file.dat' using 1:2:3
But now if I put "using 1:2:3" the script gives me an error.
Edit: Ok. It seems now it works, I added the line:
infile = sprintf('fort.1%02.0f',10*t)
splot infile using 1:2:3
Edit: Fixed. Now it works.
Last edited: