XmGrace day-to-day usage
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 )
- Load your file into xmgrace
- Go to Data->Transformations->Evaluate expressions
- Select G0.S0
- 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)
- Load your file into xmgrace
- Go to Data->Transformations->Sample points
- Select the desired set (presumably S0)
- Change sample type for ’Expression’
- 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)
- Load file1 into xmgrace (it will appear as set 0)
- Load file2 into xmgrace (it will appear as set 1)
- Go to Data->Transformations->Evaluate expressions
- Select g0.s1
- Fill in the box with :
- copy s1 to s2
- s2.x=s0.y
- 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, ...)
- Load your file into xmgrace
- Go to Edit->Data sets
- 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