Bash script which plots data using XMGRACE tool

前端 未结 1 1712
[愿得一人]
[愿得一人] 2021-01-27 05:13

I have written a bash script that generates files containing data and saves them to a directory. I would like my script to also plot these files using xmgrace.

Initially

1条回答
  •  情话喂你
    2021-01-27 05:27

    Yes, it is possible to call xmgrace/Grace without the GUI (using gracebat), but the commands you have used must first be inside a script file.

    Contents of file "script.bat":

    xaxis label "Label 1" 
    yaxis label "Label 2" 
    DEVICE "EPS" OP "level2"
    PRINT TO "plot.eps"
    PRINT
    

    Now, for a two-column data file "data.dat" you call a sister executable named gracebat which is the same as xmgrace but operates in batch mode (without the GUI):

    gracebat -nosafe data.dat -batch script.bat

    where

    -batch

提交回复
热议问题