I use xmgrace to plot data sets and I would like to add two data sets together.
So I have two files:
data1
1 1
2 4
3 9
...
data2
1 2
2 3
3 4
...
I start xmgrace with
xmgrace data1 data2
Then I see both files plotted. Now I would like to generate a third graph which is just data1+data2 like
1 3
2 7
3 13
...
I know that this is extremely simple, but for some reason I don't understand how that works.
I played with the feature Data->Transformations->Evaluate expression... but I don't know what to select as "Source" and as "Destination".
PS: I know many other ways to reach my goal but I also want to be able to do it with xmgrace.
This can easily be achieved using the feature Evaluate expression...
xmgrace data1 data2
Click on Data
->Transformations
->Evaluate expression...
Select any one (say G0.S0
) of the two sets (G0.S0
and G0.S1
) as the source. Do not select any existing set as the destination if you want the output to a new set. The Formula should read
y=g0.s0.y+g0.s1.y
The evaluateExpression
window should look like
When you Apply
, a new set (G0.S3
) will be created. You can modify the formula (g1
for graph G1
, etc.) to add values across different graphs as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With