Transform axis problem

Hi Guys

I have a bottom axis and I wish to create a mirror axis at the top which is related to the tick values x of the bottom axis by a natural log ln(x).

Here is my code in the procedure file:


Function TransAx_naturallog(w, x)
Wave/Z w
Variable x

return ln(x)
end

But when I apply the New Transform Axis, it shows this message (see attached). Can somebody tell me what it means and what should the coefficient wave in the " New Transform Axis" box should be?
Igor_user wrote:
But when I apply the New Transform Axis, it shows this message (see attached). Can somebody tell me what it means and what should the coefficient wave in the " New Transform Axis" box should be?


The axis should only span positive values as the ln is not defined in [-inf,0]. Could this be your problem?
A
awirsing wrote:
Igor_user wrote:
But when I apply the New Transform Axis, it shows this message (see attached). Can somebody tell me what it means and what should the coefficient wave in the " New Transform Axis" box should be?


The axis should only span positive values as the ln is not defined in [-inf,0]. Could this be your problem?
A


The ranges of my both axes have min > 0. So there is no negative value. Sometimes I really find Igor doesn't explain the problem very clear.
awirsing wrote:
Igor_user wrote:
But when I apply the New Transform Axis, it shows this message (see attached). Can somebody tell me what it means and what should the coefficient wave in the " New Transform Axis" box should be?


The axis should only span positive values as the ln is not defined in [-inf,0]. Could this be your problem?
A

That's correct- it indicates that the transformation is not defined over the entire range. Change your function to this:
Function TransAx_naturallog(w, x)
    Wave/Z w
    Variable x

    if (x > 0)
        return ln(x)
    else
        return NaN
    endif
end

And make sure your bottom axis doesn't include any X value less than or equal to zero. Actually, I think TransformAxis might be smart enough to simply ignore the range where the transform returns NaN, but I'm not sure.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
johnweeks wrote:
awirsing wrote:
Igor_user wrote:
But when I apply the New Transform Axis, it shows this message (see attached). Can somebody tell me what it means and what should the coefficient wave in the " New Transform Axis" box should be?


The axis should only span positive values as the ln is not defined in [-inf,0]. Could this be your problem?
A

That's correct- it indicates that the transformation is not defined over the entire range. Change your function to this:
Function TransAx_naturallog(w, x)
    Wave/Z w
    Variable x

    if (x > 0)
        return ln(x)
    else
        return NaN
    endif
end

And make sure your bottom axis doesn't include any X value less than or equal to zero. Actually, I think TransformAxis might be smart enough to simply ignore the range where the transform returns NaN, but I'm not sure.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com


No, the same message still shows up. What is that coefficient wave in the " New Transform Axis" box should be?