开发者

How do I plot some data (using xmgrace in the terminal) using dots, not lines, without explicitly changing it in the GUI?

开发者 https://www.devze.com 2023-02-13 17:37 出处:网络
i\'m using xmgrace in the terminal, and want the data to be displayed directly as dots instead of lines. Achieving this in the GUI is simple, but I have to read in multiple files, and do not want to c

i'm using xmgrace in the terminal, and want the data to be displayed directly as dots instead of lines. Achieving this in the GUI is simple, but I have to read in multiple files, and do not want to change it every time i start xmgrace. Can I add a command to the files that are read in? Or can I use an option in the terminal开发者_如何学Go when I start xmgrace?


The correct way to set the appearance of a plot from the commandline is to use an existing parameter file, specified using the flag

-param settings.par

The parameter file can be stored beforehand, using the GUI to modify the appearance of an existing, similar plot. Modify the plot as you like, then save the appearance settings in a parameter file (convention is to use the extension .par) using Plot > Save Parameters.

A typical example command would then be

xmgrace -block data2.dat -bxy 1:4 -block data2.dat -bxy 1:6 -param settings.par

In my experience, calling the

-param 

flag last thing in your command works best.

There really is no need to be manually text-editing your grace plot files (.agr) to achieve this.


xmgrace has a full and complex language for expressing the configuration of the look and feel for the graph. There are two ways to go about what you described. The simple way is to load the dataset into xmgrace, change everything to make it look the way you want, then save the dataset. You will see the dataset now has tons of lines describing the configuration "@g0 on" "@ s0 linestyle 1" etc with your dataset at the end, terminated by a &.

To replicate that graph, spit out the saved header, insert your data, and the insert the trailing &. Feed the result into xmgrace and everything will be all set up. Once you get comfortable you can start doing dynamic substitutions to rename the graph or change the symbol or whatever. See /usr/share/grace/examples for examples of what grace can do (and the config files which generate that).

The more complex method is to load the dataset, save it immediately, change it to look the way you want, and then save it again under a different name. Run diff on the two files and you will get a set of changes. You might need at most a handful of other lines from the non-changing portion, but that is somewhat rare. This produces the minimal set of fixed headers you need to prepend to the dataset. It usually isn't worth the effort to reduce the prefix size.

0

精彩评论

暂无评论...
验证码 换一张
取 消