How to plot data without a separate file by specifying all points inside the Gnuplot script?

前端 未结 6 742
死守一世寂寞
死守一世寂寞 2020-12-02 20:19

My program generates bash scripts that call gnuplot. I don\'t want to have to make an extra file to store the data; is there any way I can explicitly call all of the values?

6条回答
  •  失恋的感觉
    2020-12-02 21:04

    You can use the syntax for inline data - filename '-'.

    The following example produces a simple plot in a GIF image (bash script):

    gnuplot << EOF
    set terminal gif
    set output 'plot1.gif'
    plot '-' using 1:2
            1 10
            2 20
            3 32
            4 40
            5 50
            e
    EOF
    

提交回复
热议问题