comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Plotting lookback time (in Gyrs) and redshift on two x axis in IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Plotting lookback time (in Gyrs) and redshift on two x axis in IDL [message #89770] Wed, 03 December 2014 03:47 Go to previous message
johndraper1993 is currently offline  johndraper1993
Messages: 3
Registered: December 2014
Junior Member
Hey, I recently came across this forum which discusses the difficulties in plotting two different x axis on the same plot.

https://groups.google.com/forum/#!topic/comp.lang.idl-pvwave /_ooU4X875i0

One contributer wrote

"IDL> plot,indgen(10),YRANGE=[1,12],YTITLE='first linear
axis',YSTYLE=9,POSITION=[.1,.1,.9,.9],CHARSIZE=2
IDL>
axis,YSTYLE=1,YAXIS=1,YTICKFORMAT='conv_axis',CHARSIZE=2,YTI TLE='second
non-linear axis'

where 'conv_axis' is the name of the function which does the
conversion (e.g.):

function conv_axis,axis,index,value
return,string(FORMAT='(F0.1)',value^1.5*exp(-value^2/100))
end"

I tried to use what this user wrote in my code:

window,0
plot,res,rho*5000,/Ylog,XTITLE='Time (Gyr)',YTITLE='Log(dp/dt) (Solar Mass Mpc^-3 yr^-1)', XRange=[12,0] ;plot z against phi
axis, XAXIS=1,XTICKFORMAT=z,XTITLE='redshift'

Note: res is the time in gigayears given here:
res=9.777505969(2./3/h/sqrt(1.omega_m))*asin(sqrt((1.omega_m )/omega_m)/(1.+z)^(3./2)) ;turns z into Giga years

I was unsure what function to set equal to XTICKFORMAT, do i need to create a function to convert Gigayears into redshift?

Please say if you would like to see any more of the code, as it is quite long i left most of it out.

Thanks in advance, John
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Bug report: Draw window resolution
Next Topic: FFT on time series NDVI image

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 09:20:05 PDT 2025

Total time taken to generate the page: 0.00369 seconds