Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use a timestamp to name a gnuplot file?

Tags:

gnuplot

Is it possible to name my gnuplot out file with the date and time it was created? I currently create files with set names as follows:

     set term post eps color
     set output '/path/dateandtime.eps'
     plot
     set term x11
like image 777
astromonerd Avatar asked Mar 23 '23 01:03

astromonerd


1 Answers

You can use the builtin function time to get the current timestamp and strftimeto format it:

set output strftime('/path/%F_%H-%M-%S.eps', time(0))
like image 160
Christoph Avatar answered Mar 24 '23 14:03

Christoph