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 produce a panel plot, with graphs looking like this:
I am having problems with three things in doing so:
1) I want to be able to specify the limits of the x- and y-axis for each graph in the panel plot (or even better for all graphs at the same time) and I haven't found how to do this.
2) The data is stored in six columns in two different files. The x-values are in column 1 for both files. I would like to be able to import the data with a similar syntax as in gnuplot where I'd use
plot 'file.dat' using 1:(2.0*$3)
to plot column 3 against column 1, and multiply the values in column 3 by 2.0. The important thing here is that I need to multiply some of the columns in one of the files with 2.0 to compare them with the content of the other file in a comprehensible way. I would also prefer a syntax where I can import the columns one at a time, instead of using
READ NXY "file.dat"
where it reads all columns and I have to KILL the ones I don't want.
3) How do I change the dimensions of the graph? Changing the dimensions of the canvas using
PAGE SIZE width, height
doesn't change the dimensions of the graph, or it does but not to fill the canvas. The default size for a panel plot with 4 by 2 graphs (which is what I want) does not show enough detail.
I have found this page to be somewhat helpful:
http://ringo.ams.sunysb.edu/index.php/Xmgrace
but it does not contain examples of everything I need to do.
So far, my batch script looks like:
# make a panel plot
arrange (1,1,.1,.2,.5,ON,OFF,OFF)
# chose the first panel
FOCUS G0
# I was hoping this line would allow me to change the axis limits, but it isn't working:
world 0, -1, 20, 1
#each file has 6 columns
#s0 to s4
READ NXY "file2.dat"
#s5 to s9
READ NXY "file1.dat"
s0 line color 1
s1 line color 2
s2 line color 3
s3 line color 4
#s5 and s6 need to be multiplied by 2.0
s5 line color 1
s5 linestyle 4
s6 line color 2
s6 linestyle 4
s7 line color 3
s7 linestyle 4
s8 line color 4
s8 linestyle 4
s9 line color 5
KILL G0.s4
xaxis label "time"
xaxis tick place normal
yaxis label "density"
PAGE SIZE 2500, 2000
See Question&Answers more detail:
os