Modify mirror axis

Hej!

I have a problem with my mirror axis. So normally it displays the same range and values as the original axis. But I want to display the mirrored x-axis computed as: mirrored x-axis = 1000/(X-axis)-273.15

So, I want to put diverse temperature back to T(°C) on the mirrored x-axis without having T(°C) data.
Is there a simple way to do this in Igor?
An example of a plot with the normal mirror axis is attached.

Cheers,
Jan
First of all, I have never used mirror axes before, so there may be an easier way to get what you want rather than what I describe below.

On some of my graphs I need to have 2 bottom axes, one that shows point scaling of a wave and one that shows the time scaling of the same wave.

The way I've gotten this to work is that I created a new free axis on the graph. I then used ModifyFreeAxis to set the master axis for my free axis. In addition, I created a simple axis hook function that responds to changes in the limits of the master axis by modifying the limits and units of the free axis.

You should read the command help for the NewFreeAxis and ModifyFreeAxis operations for more information on how to do this. If necessary, I can dig up a code sample for you.
With your graph frontmost, choose Graph->Packages->Transform Axes

Then click the help button to see how to create a custom transform.
Larry Hutchinson wrote:
With your graph frontmost, choose Graph->Packages->Transform Axes

Then click the help button to see how to create a custom transform.


That was exactly what I was looking for. Thanks a lot...
I will post my solution so other people know how it works.

Put following code in a procedure window and compile:

Function TransAx_Temp(w, x)
    Wave/Z w
    Variable x
   
    return 1000/x-273.15
end


Then go to Graph -> Packages -> Transform Axes.
As Function choose in this case "Temp" and as axis "bottom". Check the box "Make it a mirror axis".
That's it.


warakurna wrote:


That was exactly what I was looking for. Thanks a lot...
I will post my solution so other people know how it works.

Put following code in a procedure window and compile:

Function TransAx_Temp(w, x)
    Wave/Z w
    Variable x
   
    return 1000/x-273.15
end


Then go to Graph -> Packages -> Transform Axes.
As Function choose in this case "Temp" and as axis "bottom". Check the box "Make it a mirror axis".
That's it.




That's an Arrhenius transformation, isn't it? It takes in degrees C and makes a plot of inverse absolute temperature. But tell me what the factor 1000 does?

I've also seen this as Tm/(x-273.15), where Tm is melting temperature.

Perhaps I should add some canned Arrhenius transformation function.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
johnweeks wrote:

That's an Arrhenius transformation, isn't it? It takes in degrees C and makes a plot of inverse absolute temperature. But tell me what the factor 1000 does?


Hej,

It's common to show Arrhenius plot for diffusion data of trace elements in glasses etc. Sometimes it is also shown in 10000/(x-273.15). That's makes data easier to read from the axis. The "back" transformation helps to read the temperature in °C (or any other), so you have all the information in one plot without thinking about "what's 0.8 again in °C ?"
To add some standard Arrhenius transformation function to Igor would be great. I know quite a lot people who are working with such functions and some also do it with Igor...

Best regards,
Jan Stelling
Hej,

Here is another problem with a mirror axis that I'm not able to solve!

All I wanted to get, is a conversion of the Bragg law from nλ = 2d sin θ to d = nλ / 2 sin θ to get a transform mirror axis that is calculated from 2θ values to d.
So, I did the following:
Function TransAx_2Theta_d(w, x)
    Wave/Z w
    Variable x

    return 1.541838/2*sin(x/2)
end

where 1.541838 is λ and x is the 2θ value of my x axis that has to be divided by 2 to get 1θ.
In short, It did not work! I think it has something to do with the sin() operator. Does someone has a clue or hint because this conversion is really needed. Or did I do some simple mistake that I really can't see...

Thanks in advance,
Jan
johnweeks wrote:


That's an Arrhenius transformation, isn't it? It takes in degrees C and makes a plot of inverse absolute temperature. But tell me what the factor 1000 does?


The transformation with the factor of 1000 converts oC to inverse milli-Kelvin. An Arrhenius function has the form Y = A exp(-E/RT) where A and E are parameters for the process, R is the gas law constant, and T is the temperature (K). In essence, when a process is activated such that it has an energy barrier E to overcome, we supply thermal energy RT to overcome it. Chemical reactions are activated, as is the process of creating vacancy defects in materials, to name a few examples.

The most common application of the conversion is to linearize the Arrhenius equation to plot ln(Y) vs 1/T, thereby obtaining E from the slope. This is an exercise that is taught to almost all undergrad science and engineering majors somewhere in their studies. For this case then, here are some helpful functions that might be nice to have "canned":

oC -> 1/K [1/K]: return (1/(x + 273.15))
oC -> 1/K [1/mK]: return (1000/(x + 273.15))

HTH

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
warakurna wrote:
Hej,

.... where 1.541838 is λ and x is the 2θ value of my x axis that has to be divided by 2 to get 1θ.
In short, It did not work! I think it has something to do with the sin() operator. Does someone has a clue or hint because this conversion is really needed. Or did I do some simple mistake that I really can't see...


Without going through the details, one thing you might consider is whether the sin() function in Igor uses angle in degrees or radians, and then what does your experiment give as angle, degrees or radians.

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
jjweimer wrote:

Without going through the details, one thing you might consider is whether the sin() function in Igor uses angle in degrees or radians, and then what does your experiment give as angle, degrees or radians.


Hej,
The XRD machine itself gives 2θ values in degree. I will check if Igor requires radian. I hope not! I already do a lot of data conversion stuff.
If you still have a hint, please let me know...

Thanks and cheers,
Jan
Finally I got it working!
Indeed it was the case that Igor's sin() function takes radian instead of degree. So, I had to calculate radian from my 2θ degree values.

The correct version of the transform axis function looks like this:
Function TransAx_2Theta_d(w, x)
    Wave/Z w
    Variable x

    return 1.541838/(2*sin((x/2)*(Pi/180)))
end


Hope that some of you get it started as well (when needed!)...