Plotting arrows with gnuplot

后端 未结 3 640
轻奢々
轻奢々 2021-01-18 07:37

I have data generated in a simulation. The generated data file looks something like this:

1990/01/01 99
1990/01/02 92.7
1990/01/03 100.3
1990/01/04 44.2
1990         


        
3条回答
  •  长情又很酷
    2021-01-18 08:32

    Although the question is quite old, here is my answer.

    One can use the vectors plotting style, which can use variable arrowstyles based on a column's value:

    set style arrow 1 backhead
    set style arrow 2 head
    set yrange[0:*]
    set xdata time
    set timefmt "%Y/%m/%d"
    plot "simulation.dat" using 1:2 with line,\
         "" using 1:2:(0):(-$2):($3 == 0 ? 1/0 : $3) with vectors arrowstyle variable
    

    It the value of a column is 1/0, the point is considered as undefined and is skipped.

提交回复
热议问题