1
votes

I am creating a 2D plot from several data files (snapshot_XXXX.dat) using the following snippet

set terminal pngcairo
n=1000  # Number of snapshots

load 'color.pal'
# cbrange[-6:-2]
unset key
set style fill solid

set ylabel "Snapshot/Time"
# set yrange [0.5:n+0.5]
# set ytics 1    # manage it well in order to avoid black lines at the 
borders
set xrange[0:2021]
set yrange[0:8]
# This functions gives the name of the snapshot file
snapshot(i) = sprintf("snapshot_%04d.dat", i)
plot for [i=1:n] './snapshots/'. snapshot(n+1-i) using 1:2:3 with boxes 
     linecolor palette

where the result is: picture

The snapshots look like

snapshot_0001.dat  snapshot_0002.dat  snapshot_0003.dat  
   1 1.0 0.0            1 1.0 0.0            1 1.0 0.0           
   2 1.5 0.0            2 1.5 0.0            2 1.5 0.0           
   3 2.0 0.5            3 2.0 0.7            3 2.0 0.7            
   4 2.5 1.0            4 2.5 1.5            4 2.5 1.5           
   5 3.0 0.5            5 3.0 0.7            5 3.0 1.1           
   6 3.5 0.0            6 3.5 0.0            6 3.5 0.7           
   7 4.0 0.0            7 4.0 0.0            7 4.0 0.0          
   8 4.5 0.0            8 4.5 0.0            8 4.5 0.0           
   9 5.0 0.0            9 5.0 0.0            9 5.0 0.0            

Of course these are fake data since the original files are too heavy to add to this post. I would like to add horizontal lines at particular times (axis labelled SnapShot/TIME).

Is someone can help me with this issue?

1

1 Answers

1
votes

This solves my problem

set arrow from 0.,5.6 to 2021., 5.6 nohead front lc rgb "black" lw 4 dashtype "-"

Many thanks Christoph