I am trying to use a batch script to plot data with xmgrace. However, I have encountered major problems in trying to find documentation on how to do this. I am trying to pro
1) To specify the limits of the x- and y-axis for all graphs at the same time, use the following commands.
WORLD XMIN 0
WORLD XMAX 20
WORLD YMIN -2
WORLD YMAX 2
and optionally specify the ticks (major and minor) along x-axis as
XAXIS TICK MAJOR 0.5
XAXIS TICK MINOR 0.25
2) The syntax to import the columns one at a time is
READ BLOCK "file2.dat"
BLOCK xy "1:2"
BLOCK xy "1:3"
BLOCK xy "1:4"
BLOCK xy "1:5"
READ BLOCK "file2.dat"
BLOCK xy "1:2"
BLOCK xy "1:3"
BLOCK xy "1:4"
BLOCK xy "1:5"
BLOCK xy "1:6"
To perform algebraic operations with specific columns, such as multiplying columns 2
and 3
of "file.dat"
with 2
, you can use
s4.y = 2*s4.y
s5.y = 2*s5.y
Note that as additional blocks of data are read in, newer sets with incremental suffixes are created, such as s0, s1, s2, ....
. Since column 6
of file2.dat
is not read, the sets are numbered differently here relative to the original script.
3) To change dimensions of a graph (say G0
)
FOCUS G0;
VIEW 0.15, 0.15, 0.15, 0.85