2009/1/22

xmgrace and grace

Grace is a WYSIWYG 2D plotting tool for the X Window System and M*tif. Grace runs on practically any version of Unix-like OS
Homepage: http://plasma-gate.weizmann.ac.il/Grace/
The most important is that batch file
My sample:
********************************
* READ NXY "He-Raja-G01.rate" *
* READ NXY "He-Raja-G02.rate" *
* s0 line color 1 *
* s1 line color 2 *
* s0 legend "ionization" *
* s1 legend "Excitation" *
* PRINT TO "asfdaa.jpg" *
* HARDCOPY DEVICE "JPEG" *
* PRINT *
*********************************
Below samples are from wiki: http://ringo.ams.sunysb.edu/index.php/Xmgrace

Sample Xmgrace input batch file

READ NXY "5M030.rmsd1.txt"
READ NXY "5M030.rmsd2.txt"
s0 line color 1
s1 line color 2
s0 legend "pose1 rmsd"
s1 legend "pose2 rmsd"
title "RMSD"
xaxis label "time (ps)"
yaxis label "RMSD (angstroms)"
PRINT TO "${system}.eps"
DEVICE "EPS" OP "level2"
PRINT

Run Xmgrace with the command

xmgrace -batch temp.bfile -nosafe -hardcopy

where temp.bfile is the name of the batch file nosafe allows xmgrace to write the output eps plot hardcopy means make the plot and exit. Do not show gui.

For high resolution png file output with transperant background: The DEVICE "PNG" DPI dpi does not seem to change anything.

PRINT TO "output.png"
HARDCOPY DEVICE "PNG"
PAGE SIZE 2560, 2048
DEVICE "PNG" FONT ANTIALIASING on
DEVICE "PNG" OP "transparent:on"
DEVICE "PNG" OP "compression:9"
PRINT

Print to jpg

HARDCOPY DEVICE "JPEG"
DEVICE "JPEG" OP "optimize:on"
DEVICE "JPEG" OP "quality:100"
DEVICE "JPEG" OP "smoothing:40"
PRINT TO DEVICE
PRINT TO "testtest.jpg"
PRINT