pipe plot data to gnuplot script

后端 未结 6 2029
终归单人心
终归单人心 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:06

    How about using the system() command

    set terminal png
    set output "test.png"
    
    # read shell input
    # the echo prints the variable, which is then piped to gnuplot
    fname = system("read filename; echo $filename")
    
    plot for[col=2:4] fname using 1:col title columnheader(col) with lines 
    

    You can call it now with

    echo "data.txt" | gnuplot script.gp
    

提交回复
热议问题