how to make several plots from the same standard input data in gnuplot?

后端 未结 4 1042
迷失自我
迷失自我 2020-12-31 09:53

I want to have a single .plt file storing both data and gnuplot commands. My data looks like

# x1 y1 x2 y2
  1  2  3  4
  5  6  7  8

and co

4条回答
  •  不思量自难忘°
    2020-12-31 10:09

    I'm not sure how much you can edit the file, but the tidiest way is probably to put the whole thing in a shell script/batch script (are you on linux or windows?)

    On linux I do something like this

    #!/bin/bash
    
    #put my data in a file
    echo "
    # x1 y1 x2 y2
      1  2  3  4
      5  6  7  8
    " > my_dat.dat
    
    #launch gnuplot
    gnuplot<

    Then I chmod +wrx the file I put the above commands in and run.

    Note: there also seems to be a similarity to this question:

    gnuplot stdin, how to plot two lines?

    So you might want to look there too

提交回复
热议问题