|
From: Thomas S. <t.s...@fz...> - 2011-04-23 11:58:47
|
let the fortran program write a file with the actual index number
(only one line containing the number, nothing more)
then read the content of this file into a variable and use this
variable to construct the filenames:
# read the content of the file, instead of 'cat' you may have to use
# another command on a non-unix system.
i=system("cat whatever_the_filename_is")
set size 1, 1
set term jpeg 1200, 800
set output "particles".i.".jpeg"
plot "partx".i.".txt","party".i.".txt","partz".i.".txt"
ParticlesRule wrote:
>
> Hello,
>
> I have currently written a Fortran 77 simulation program that I need to
> display graphically for each timestep. So far it calls the system to have
> gnuplot open an include file that has the gnuplot script to plot from my
> data files and produce a jpeg. What I would like to do is have it do is
> make a jpeg for every time step that I can combine together into an mpeg
> so that I can watch how my system evolves graphically.
>
> Here is what I have so far for this part of the code:
>
> call system ("gnuplot particles.in")
>
> Then it goes to the include file with the gnuplot script
>
> set size 1, 1
> set term jpeg 1200, 800
> set output "particles0.jpeg"
> plot "partx0.txt","party0.txt","partz0.txt"
>
>
> So for the partx0,party0, and partz0 text files, my fortran program opens
> them at the beginning of the time step loop, writes the data into two
> columns into each of them, then closes them and calls the system to have
> gnuplot look at the include file.
>
> Everything works great except that at every timestep while the program is
> running, since the text files reset and get a new batch of data and the
> include file points to the same jpeg as the output, it keeps resetting the
> picture.
>
> So if anyone knows what I would have to do in the fortran code or the
> gnuplot script to make it make as many pictures as I have timesteps (ie.
> particles0.jpeg,particles1.jpeg,
> particles2.jpeg,particles3.jpeg,...,particlest.jpe g for t timesteps) it
> would be very much appreciated. I have searched everywhere for the answer
> and the very few I found were for C, not Fort 77.
>
> Thank you in advance!
>
--
View this message in context: http://old.nabble.com/Fort-77-and-gnuplot-iterative-output-jpegs-tp31457843p31461296.html
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|