Different top and bottom axes

Hello I am trying to plot a spectrum with energy on bottom, and wavelength on top. The conversion is wavelength=1240/energy.

I tried using the transform axes function with mirroring but it was placing the axis label inside of the graph instead of on the perimeter. It was also not connecting the top axis to the left axis leaving some white space in between. Does anyone have a suggestion of another method?
This can be done using NewFreeAxis, but there is some work involved. The following procedure would help, just run freetopEn(), and enter the labels you would like in the table that pops up. The corresponding tick positions are updated accordingly, so don't change the right column. Enjoy!
//Given a graph with as bottom axis, it creates a top axis as (1240/bottom axis), to convert energy and wavelength, or vice versa
Function freetopEn()
    // read current windowname
    String Stw=WinName(0,1)
   
    // make free axis called freetop
    NewFreeAxis /T freetop
   
    // do not mirror bottom, and put new axis on the top
    modifygraph mirror(bottom)=0,freepos(freetop)=0
   
    // connect top axis to bottom axis
    ModifyFreeAxis freetop,master=bottom
   
    // make waves for labels
    make/T/O /N=10 $("ticklabel"+Stw)
    make/O /N=10 $("tickposition"+Stw)
    wave /T wlab=$("ticklabel"+Stw)
    wave wpos=$("tickposition"+Stw)

    // enter limiting values
    GetAxis /Q bottom
    wlab[0]=Num2str(1240/V_min)
    wlab[1]=Num2str(1240/V_max)
   
    // Couple positions to 1240/label wave
    SetFormula wpos, "1240*(str2num("+NameofWave(wlab)+"[p]))^-1"
   
    // open for editing, user may enter more values
    edit $("ticklabel"+Stw),$("tickposition"+Stw) as "Tick labels and positions for "+Stw
   
    // attach waves to freeaxis
    ModifyGraph userticks(freetop)={wpos,wlab}
    print "Please enter tick labels in the table, tickpositions update accordingly"
End
Transform Axis package uses free axes to do its work...

The default location of the axis label is weird. Drag it to a better location, or double-click the axis and then change the position in the Label Options tab of the Modify Axis dialog.

The gap at the left axis is cause by Igor's "axis standoff". It prevents markers from obscuring the axis lines, but as you have found it can have less desirable effects.

Double-click the left axis, select the Axis tab, and turn off the Axis Standoff checkbox.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com