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

Home » Public Forums » archive » Re: plot axis problem?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: plot axis problem? [message #55121 is a reply to message #55114] Wed, 01 August 2007 01:18 Go to previous message
Wox is currently offline  Wox
Messages: 184
Registered: August 2006
Senior Member
On Wed, 01 Aug 2007 05:40:26 -0000, metachronist <rkombiyil@gmail.com>
wrote:

> IDL Gurus,
> I think this is too trivial.. but anyways I can't get it right :(
>
> IDL> time=[22.,23.,0.,1.,2.,3.,4.,5.,6.,7.]
> IDL> field=[4.2,56.7,89.34,22.,0.,43.5,10.,2.,33.,-10.5]
>
> So the time values start at 2200hrs and then go past midnight and then
> to 0700hrs in the morning. How would I "force" the 'x' axis (time) to
> start at 22hrs goto (midnight) 0hrs and then increase to 7hrs? I
> found out that setting xrange wouldn't help either since the decrease
> (increase in terms of time) from 2200hrs --> 2400hrs(0hrs) is IDL way?
> Like (22,20,18,....0,2,...8) , as a result, nothing gets plotted :(
> Thanks for any suggestions,
> /rk

Well, you could change the thick names:

time=[22.,23.,0.,1.,2.,3.,4.,5.,6.,7.]
field=[4.2,56.7,89.34,22.,0.,43.5,10.,2.,33.,-10.5]

n=n_elements(time)
ind=where(time[1:*] lt time[0:n-2],ct)
time2=time
for i=0,ct-1 do time2[ind[i]+1:*]+=24

plot,time2,field,XTICKN=strtrim(fix(time),2)+'hrs'
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: .FULL_RESET_SESSION
Next Topic: Re: diferent results in program and envi

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

Current Time: Sat Oct 11 14:40:04 PDT 2025

Total time taken to generate the page: 1.20193 seconds