I have a graph and I just want to rotate it 90°, which could be accomplished if I could flip the x and y axis. How can I do it? I have no experience in using xmgrace via terminal.
3 Answers
Step 1: Click “Data” from the menu bar. Select “Transformations.” Then select “Geometric transforms…”
Step 2: Select the set(s) or “All sets.” Enter “90.0” in the “Rotation (degrees)” field. Enter “-1.0” in the “Scale X” field.
Step 3: Click Accept. Click Close.
Step 4: Autoscale graph (one can use the “AS” tab from the toolbar).
Note: This works on Grace-5.1.25. You could play with the “Geometric transform…” fields by entering different values, if you want to, to get your desired results.
PS: I learned this trick from my advisor.

- 92
- 1
- 8
-
Is this possible to use these steps in command line? When I make a parameter file (.par) in the figure of vertical axis (rotation of 90 degree), it cannot be applied to new plot with $xmgrace ... -p a.par. – Joonho Park Feb 17 '22 at 07:00
It is very easy and the logic of the steps goes like this. Create a new set with flipped axis and update the set for further analysis. I also added in step 5 to autoscale the two axes, you can omit that step if you think otherwise.
In xmgrace
window, go to
- Data → Transformations → Evaluate expression.
- Click on the parent set to be represented as flipped axes, lets assume it is
S0
. In the
formula
section, writes1.x=s0.y; s1.y=s0.x
and click apply. This will create a new setS1
which is the flipped axes representation ofS0
.Click on View → Update all and then View → Redraw. This will update and draw the newly created set for further analysis.
- On main window, click on Edit → autoscale graphs.... This will autoscale the two graphs.

- 301
- 3
- 8
if you want to treat multiple sets at once this trick could work:
x = y*x; y=x/y; x=x/y
Make sure that your original y has nonzero values.

- 11
- 1