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

Home » Public Forums » archive » Re: add a period axis?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: add a period axis? [message #27153] Wed, 10 October 2001 21:52 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
jiali (jiali3@21cn.com) writes:

> I wonder how to add another axis. First create a frequency-power plot:
>
> plot,fre,power,xrange=[1,10],yrange=[0,10],xtitle='Frequency '
>
> I hope to add an axis on the top but with period(=1/frequency) ticks. Maybe
> like following:
>
> aixs,1,10,/xaxis,xrange=[1,0.1], xtitle='Period',......???
>
> Would you please help me to finish the above?

Well, it will be something like this:

plot,fre,power,xrange=[1,10],yrange=[0,10], $
xtitle='Frequency', xstyle=8, $
position=[0.15, 0.15, 0.95, 0.85]
axis, xaxis=1, xrange=[1,0.1], xtitle='Period', /save

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: add a period axis? [message #27272 is a reply to message #27153] Fri, 12 October 2001 13:03 Go to previous message
jeyadev is currently offline  jeyadev
Messages: 78
Registered: February 1995
Member
In article <MPG.162ed391d0e34c3c989704@news.frii.com>,
David Fanning <david@dfanning.com> wrote:
> jiali (jiali3@21cn.com) writes:
>
>> I wonder how to add another axis. First create a frequency-power plot:
>>
>> plot,fre,power,xrange=[1,10],yrange=[0,10],xtitle='Frequency '
>>
>> I hope to add an axis on the top but with period(=1/frequency) ticks. Maybe
>> like following:
>>
>> aixs,1,10,/xaxis,xrange=[1,0.1], xtitle='Period',......???
>>
>> Would you please help me to finish the above?
>
> Well, it will be something like this:
>
> plot,fre,power,xrange=[1,10],yrange=[0,10], $
> xtitle='Frequency', xstyle=8, $
> position=[0.15, 0.15, 0.95, 0.85]
> axis, xaxis=1, xrange=[1,0.1], xtitle='Period', /save

Awww! This is too easy! It does help that 1.0 lines up with 0.1, 2.0 with
0.2, ... etc. Things look nice. How about when you want to have
xrange = [0,15], but you want the upper axis to be some specific values
that are calculated from the lower axis. I run into this typically in
trying to have two different ways of specifying the same underlying
variable. For a no so moronic example, let the x axis be some length
in metres. Now, for some people's benefit, I would like to have
feet on the upper scale. But, it is ugly to have 1.5432, 2.1793, ...
labels. One would like that hash marks to be laid at 1.5, 2.0, etc.
Any chance of a routine out there?

thanks


--

Surendar Jeyadev jeyadev@wrc.xerox.com
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL to IGOR Pro (was Re: Insight...)
Next Topic: Re: Mac Scoop (Long)

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

Current Time: Fri Oct 10 22:36:58 PDT 2025

Total time taken to generate the page: 0.08666 seconds