How to use batch script with xmgrace
<p>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:</p>

<p><a href="https://i.stack.imgur.com/5i9K5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5i9K5.png" alt="enter image description here"></a></p>

<p>I am having problems with three things in doing so:</p>

<p>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.</p>

<p>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 </p>

<blockquote>
  <p>plot 'file.dat' using 1:(2.0*$3) </p>
</blockquote>

<p>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</p>

<blockquote>
  <p>READ NXY "file.dat"</p>
</blockquote>

<p>where it reads all columns and I have to KILL the ones I don't want.</p>

<p>3) How do I change the dimensions of the graph? Changing the dimensions of the canvas using</p>

<blockquote>
  <p>PAGE SIZE width, height</p>
</blockquote>

<p>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.</p>

<p>I have found this page to be somewhat helpful:
<a href="http://ringo.ams.sunysb.edu/index.php/Xmgrace" rel="nofollow noreferrer">http://ringo.ams.sunysb.edu/index.php/Xmgrace</a></p>

<p>but it does not contain examples of everything I need to do. </p>

<p>So far, my batch script looks like:</p>

<blockquote>
  <p># make a panel plot<br>
   arrange (1,1,.1,.2,.5,ON,OFF,OFF)<br>
   # chose the first panel<br>
   FOCUS G0<br>
   # I was hoping this line would allow me to change the axis limits, but it isn't working:<br>
   world 0, -1, 20, 1<br>
   #each file has 6 columns<br>
   #s0 to s4<br>
   READ NXY "file2.dat"<br>
   #s5 to s9<br>
   READ NXY "file1.dat"<br>
       s0 line color 1<br>
       s1 line color 2<br>
       s2 line color 3<br>
       s3 line color 4<br>
       #s5 and s6 need to be multiplied by 2.0<br>
       s5 line color 1<br>
       s5 linestyle 4<br>
       s6 line color 2<br>
       s6 linestyle 4<br>
       s7 line color 3<br>
       s7 linestyle 4<br>
       s8 line color 4<br>
       s8 linestyle 4<br>
       s9 line color 5<br>
       KILL G0.s4<br>
       xaxis label "time"<br>
       xaxis tick place normal<br>
       yaxis label "density"<br>
   PAGE SIZE 2500, 2000  </p>
</blockquote>