Search code examples
plotaxis-labelsxmgrace

How to add top x-axis in xmgrace?


I have plotted a graph with xmgrace, the x-values are in linear scale of nm (for wavelength). I want to add a top reciprocal x-axis in eV units.

The formula to transform nm to eV is:

eV=\frac{1240}{nm}

I could not find a way to add another x-axis without adding a new data set.


Solution

  • This is possible without any particular hack which, since we are dealing with xmgrace, is quite amazing :-) Here is how you do it:

    • Open the axis properties
    • Select the "Alt X axis" option in the "edit" drop-down menu
    • Go to the "Tick labels" tab
    • Select "Opposite" as the Placement side
    • Put "1240 / $t" in the "Axis transform" textbox at the bottom
    • Click "Apply"