XmGrace day-to-day usage

, by Stéphane

Before finding the wonderful XmGrace software, i’d loose time to do calculations, regressions, etc.

With this software, i’ve been able to do in a more robust manner and more rapidly everything i could do before and much more.

Here are some examples of what i’m using.

Some basics commands i use with XmGrace are detailed below.

Renormalizing a plot (mostly angles between -180 and +180, you want it between 0 and 360 )

  1. Load your file into xmgrace
  2. Go to Data->Transformations->Evaluate expressions
  3. Select G0.S0
  4. Fill in the box with :

y = y<=0 ? y + 360 : y

It is a basic if then else : y equals the value resulting of the test y<=0. If the test is true then y = y+ 360 otherwise take the y value

Subpopulation (for instance for an angle, where are the points above a certain value)

  1. Load your file into xmgrace
  2. Go to Data->Transformations->Sample points
  3. Select the desired set (presumably S0)
  4. Change sample type for ’Expression’
  5. Fill in the form ’Logical expression’ with your needs, for instance y=>50 will select the population where all points are equal or above 50.

Correlation between two states (for instance a sugar conformation and a dihedral angle)

  1. Load file1 into xmgrace (it will appear as set 0)
  2. Load file2 into xmgrace (it will appear as set 1)
  3. Go to Data->Transformations->Evaluate expressions
  4. Select g0.s1
  5. Fill in the box with :
    • copy s1 to s2
    • s2.x=s0.y
  6. Accept

Go back to the graph, hide s0 and s1, click on As (autoscale), you have your correlation :-) you can now fill in legends, etc.

Getting informations about points (mean, std, max, min, ...)

  1. Load your file into xmgrace
  2. Go to Edit->Data sets
  3. Pick your set, the values will be displayed in the box below (rapid, isn’t it ?)

Sending data through a pipe

echo -e "1 2\n2 4\n3 6" |xmgrace -pipe

Sending data through a fifo

 Create the fifo

mkfifo fifo.pipe
xmgrace -npipe fifo.pipe

 Send the commands through the fifo

echo "read \"data.out\"" > fifo.pipe
echo autoscale > fifo.pipe
echo redraw > fifo.pipe

Other sites with tips