Double horizontal axis (top/bottom) with different scale

Dear all,

I have three waves: Intensity, Time and Temperature. All waves have the same amount of points.
I would like to plot Intensity VS Time, where time is on the bottom axis, and then add a top axis
with the Temperature scale. The idea is that if, for example, Time 1000 correspond to Temperature 100,
than 100 have to be exactly on top of 1000 in the graph.

I tried adding the intensity vs time (bottom axis) and then intensity vs temperature (top axis), but
the curves do not overlap. I don't understand exactly why.

It seems it should be pretty straightforward, but I have been struggling to get the result I want.

Any suggestion?


Hi John,

The temperature is not a strictly linear function of time.

Here's an experiment file.


Any time Igor makes a graph of something vs somethingelse, it lays out the axes in a linear fashion. Since your temperatures are not a linear function of time, then the Intensity vs Time plot simply doesn't match the Intensity vs Temperature plot. So you see it's not a straightforward problem- you need a mirror axis with the ticks at a nonlinear spacing.

BUT there is a solution. You can use the Transform Axis package to make a mirror axis that displays ticks that are a function of the ticks on the axis it mirrors. And I have just written a transformation function that uses a wave as the source of the transformation function.

The learn more about Transform Axis, select File->Example Experiments->Graphing Techniques->Transform Axis Demo.

The package can be tricky to understand, I strongly encourage you to look at the demo.

I have attached a modified version of your experiment file that uses Transform Axis to put a Temperature top axis on a graph of Intensity vs Times. To do that, I took these steps:

0) I wrote the function TransAx_fromWave() in the main Procedure window.

1) I made the graph of Intensity vs Times.

2) From the Graph menu, I chose Packages->Transform Axes

3) From the Graph menu, I chose Transform Axis->Transform Axis.

4) In the control panel, I selected these settings:
Function: fromWave
Axis: Bottom
Turned on the Make It a Mirror Axis checkbox
Selected Temperature as the Coefficient wave

5) Click Do It.

John Weeks
WaveMetrics, Inc.

I thought I'd post a question here seeing as this seems related to the problem I am attempting to tackle. Would you be able to help me out?

I have a graph of current density (y axis, left) which is a function of potential (x axis, bottom), but not linear. What I have been trying to figure out is how to plot time on the x axis (top).

The time is a linear function of the potential (as the potential is stepped at set time intervals).

I have been trying to see if this transform axis will do the trick, but cannot seem to get it to work. I have tried creating a wave with the time in correct intervals, but of course, I cannot plot potential vs time both on the horizontal axes alongside current density on the y axis. As Fabrizio said; it seems as though this would be a simple solution, but in fact it is not!

The attachment is a screenshot of the graph; ideally I would like to plot the time on the top axis.

Can you help?

r.clark1 wrote:

The attachment is a screenshot of the graph; ideally I would like to plot the time on the top axis.
Can you help?

If you attach the entire experiment, then perhaps we can see what's going wrong.

--Jim Prouty
Software Engineer, WaveMetrics, Inc.
If your potential is a linear function of time, it should be a simple matter to write your own transform function with the correct factors in it. See one of the temperature scale functions included in the TransformAxis package as a guide. Here is the function for Centigrade to Farenheight:
Function TransAx_DegreesCtoF(w, val)
    Wave/Z w            // a parameter wave, if desired. Argument must be present for FindRoots.
    Variable val
    return val*1.8+32

Replace "1.8" and "32" with the appropriate factors for your transformation. And give the function a new name; it MUST start with "TransAx_".

John Weeks
WaveMetrics, Inc.

In reply to by johnweeks


I found the "TransAx_fromWave" using the procedure browser. 


Dear John, 

I want to use the option "TransAx_fromWave" option. I assume this is not available on the standard Transform graph package. 

I can't figure out from the TextJW.pxp file where you changed the procedure. 

I would highly appreciate it if you could help me out.