Search code examples
xmgrace

xmgrace: how to add grid lines on the XY chart?


Using xmgrace with the following batch sctipt:

s0 line color "orange"
Major grid lines On
Minor grid lines On
HARDCOPY DEVICE "PNG"
PAGE SIZE 800, 600
xaxis label char size 2.2
yaxis label char size 2.2
xaxis ticklabel char size 2.0
yaxis ticklabel char size 2.0

I am looking for the command that would allow to add a grid doted lines on the plot and varry it style.


Solution

  • You can use

    xaxis tick major grid on
    yaxis tick major grid on
    

    To enable the grid on each axis. The grid appearance can be varied by using

    xaxis tick major color 2
    xaxis tick major linewidth 2.5
    xaxis tick major linestyle 3
    

    (and similarly with yaxis)