pipe plot data to gnuplot script

后端 未结 6 2033
终归单人心
终归单人心 2020-12-02 14:49

I want to create a gnuplot with three plots in it. The data should be inline (as I want to only

It should look like this:

6条回答
  •  北荒
    北荒 (楼主)
    2020-12-02 15:24

    What's wrong with using the -e option of gnuplot from shell? You can provide a variable as input, say data.txt, from shell using:

    gnuplot -e "filename='data.txt';ofilename='test.png'" plot.gnu
    

    You should be able to call the above command multiple times with different values for "filename" from shell using a for loop.

    And then you change your script plot.gnu to:

    set terminal png
    set output ofilename
    plot for[col=2:4] filename using 1:col title columnheader(col) with lines
    

提交回复
热议问题