3

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.

Quasímodo
  • 3,812
  • 14
  • 25

3 Answers3

5
  • 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.

Skeptic Biped
  • 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
2

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

  1. Data → Transformations → Evaluate expression.
  2. Click on the parent set to be represented as flipped axes, lets assume it is S0.
  3. In the formula section, write s1.x=s0.y; s1.y=s0.x and click apply. This will create a new set S1 which is the flipped axes representation of S0.

  4. Click on View → Update all and then View → Redraw. This will update and draw the newly created set for further analysis.

  5. On main window, click on Edit → autoscale graphs.... This will autoscale the two graphs.
Sat Yam
  • 301
  • 3
  • 8
1

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.

Niels B
  • 11
  • 1