Plot in wavelength and energy axes [message #44384] |
Thu, 09 June 2005 07:28 |
burkina
Messages: 32 Registered: February 2005
|
Member |
|
|
I'd like to plot a spectrum with two different x axes, one in
wavelenght, the other in energy. The two quantities are clearly not
linear one to the other, so that I guess there's no other way than
writing my own tickmarks.
The best solution I've found is:
plot, lambda, smoothed_flux, charsize=1, xtitle=xlabel, ytitle=ylabel,
xrange=[lambda_min,lambda_max], yrange=[miny*0.9,maxy*1.25],
xstyle=1+8, ystyle=1
axis, xaxis=1, xtickv=[wave2kev, wave2kev/0.9, wave2kev/0.8,
wave2kev/0.7, wave2kev/0.6, wave2kev/0.5], xticks=8, xstyle=1,
xtickname=[0.8, 0.9, 0.8, 0.7, 0.6, 0.5], xtitle="Energy (keV)"
It works, but:
1. I also would like to put ten minor tickmarks for each interval (at
positions, say, wave2kev/0.81, wave2kev/0.82, .....), but without the
labels. How can I do that? Clearly, they are also not linear, so I
cannot simply let IDL draw them for me with the xminor key.
2. Why IDL keeps on writing 1.00000 instead of 1.0 in my new axis!?!
What should I do? I tried with xtickunits, but then it puts back the
labels in wavelenght!!!
Thanks,
Stefano
|
|
|