Simple means of mirror linear axis with log axis
alexabelson
I am trying to plot some data where the x-axis is ln(T) and I want to also show T on the mirrored X-axis. I was trying to use TransformAxis function but there are only a handful of options and none work for me.
I must plot ln(T) on a linear scale, instead of display T on a log-scale. See the attached image for exactly what I want to accomplish.
Thanks!
AppendToGraph Ywav vs Xwav
AppendToGraph /T Ywav vs Xwav
ModifyGraph userticks(top)={locationsOfTicks, ValuesToDisplay}
May 9, 2017 at 11:55 pm - Permalink
// make some data
Make/O/D/N=200 myData, myData_X, myData_lnX
myData=gnoise(1) + 5
myData_X[] = 50+x
myData_lnX = ln(myData_X[p])
// make first plot
Display myData vs myData_lnX
ModifyGraph mode=3,marker=8
ModifyGraph mirror(left)=2
AppendToGraph/T myData vs myData_X
ModifyGraph log(top)=1,minor(top)=1
ModifyGraph mode(myData#1)=2,rgb(myData#1)=(65535,65535,65535) // set to white dots to hide re-plot
// make second plot
Make/O/N=7 myAxisTicks
Make/O/T/N=7 myAxisTickLabels
myAxisTicks={50,60,70,80,90,100,200}
myAxisTickLabels = num2str(myAxisTicks[p])
Display myData vs myData_lnX
ModifyGraph mode=3,marker=8
ModifyGraph mirror(left)=2
AppendToGraph/T myData vs myData_X
ModifyGraph log(top)=1,userticks(top)={myAxisTicks,myAxisTickLabels}
ModifyGraph mode(myData#1)=2,rgb(myData#1)=(65535,65535,65535)
End
Hope this helps,
Kurt
May 10, 2017 at 12:15 am - Permalink
// If axis is ln(T), this transforms it to show just T
Wave/Z w
Variable x
Return exp(x)
end
It will add a "lnT" function to the New Transform Axis panel's Function pulldown menu.
It's up to you to determine if the TransformAxis package is robust enough to do what you want after that.
May 10, 2017 at 07:47 am - Permalink
Worked like a charm. Thanks everyone!
Alex Abelson
Graduate Researcher
UC Irvine
May 10, 2017 at 11:45 am - Permalink