how to show time steps on the title of successive plots in gnuplot -
i using gnuplot version 4.6. plotting graphs of physical quantity (let's say, air pressure) function of space position, based on successively created datafiles. in order obtain animation of these graphs different time steps, using following loop:
gnuplot> [n=0:400]{plot [0:1] [0:1] sprintf("data.%04d.tab", n) using 1:5 lines title 'time in seconds= ' .n} what need show on these successive graphs physical time passed since beginning of simulation, , time equal number of datafiles created graph, times constant time (the unit time of physical problem, times period between datafile writing
my question - how can show physical time in title, using file numbers?
i tried multiply file number, n, constant time (in problem: 9e^-6 seconds) restricts number of plots. how can overcome this?
use sprintf manipulate strings.
in case title sprintf('time in seconds= %.2f',n*9e-6)
so command:
do [n=0:400]{plot [0:1] [0:1] sprintf("data.%04d.tab", n) using 1:5 lines title sprintf('time in seconds= %.2f',n*9e-6)} if want title (not legend), can use set title command:
do [n=0:400] { set title sprintf('time in seconds= %.2f',n*9e-6) plot [0:1] [0:1] sprintf("data.%04d.tab", n) using 1:5 lines nottile } a lot more can done strings, here
Comments
Post a Comment