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

Home » Public Forums » archive » Re: How to plot with time as one 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: How to plot with time as one axis ? [message #33677] Sun, 19 January 2003 06:01 Go to next message
Kolbjorn Bekkelund is currently offline  Kolbjorn Bekkelund
Messages: 20
Registered: August 2002
Junior Member
Kolbjorn Bekkelund wrote:
> I have an array in this format:
>
> 18122002 00.00 2452626.500049 12.742800 20.202000 167.380800 954.355800
> 68.730800 -3.564065
>
> continuing down to:
>
> 18122002 23.59 2452627.499930 8.624700 12.121200 171.951600 955.973100
> 94.427600 -5.265564
>
> The first field is the date, second is the time (hr.min), third is the
> julian for the two first and the rest is the actual data I would like to
> plot.
>
> My problem is that if I do this:
>
> plot, data(1,*) ,data(4,*), xstyle=1, /noerase, color=119, $
> xrange=[0, 24]
>
> I get a "chopped" plot at the end of each hour since I "miss" data
> between ex. 22.59 and 23.00. IDL would like me to have all the steps
> from 22.60 and up to 22.99 as well.
>
> How can I tell IDL that I actually would like to have my xaxis in hours,
> and that in between the hours I would like to have 60 minutes and not
> tenths ?
>
> Best regards,
> Kolbjorn Bekkelund

I solved it myself like this:

xbins = Findgen(N_Elements(data(1,*)))
xrange = [Min(xbins), Max(xbins)]
yrange_wind = [Min(data(4, *)), Max(data(4, *))]
!x.tickname = ['00', '04', '08', '12', '16', '20', '24']
!x.ticks = 6
plot, xbins ,data(4,*), xstyle=1, color=119, $
XRange=xrange, Yrange=yrange_wind
oplot, xbins,data(4,*), color=166
yrange_press = [Min(data(6, *)), Max(data(6, *))]
plot, xbins, data(6,*), xstyle=4, /noerase, ystyle=4, $
XRange=xrange, color=119, Yrange=yrange_press
axis,yaxis=1, color=119
oplot, xbins, data(6,*), color=255

Kolbjorn

--
* |
| *
* |
| * |(
Kolbjorn Bekkelund * | ==|==
Systems Eng. ALOMAR Observatory | * |___|
Andoya Rocket Range ====================== |
.-. http://alomar.rocketrange.no \ [] [] [] [] [] / | ----
/v\ eMail: kobe@rocketrange.no '----------------'-------| |
/( )\ Using Linux for Science..... | [ ] | | [] | | | |
^^ ^^ --------------------------------------------------'--------- --
Re: How to plot with time as one axis ? [message #33755 is a reply to message #33677] Tue, 21 January 2003 12:18 Go to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
Kolbjorn Bekkelund wrote:
>
> Kolbjorn Bekkelund wrote:
>> I have an array in this format:
>>
>> 18122002 00.00 2452626.500049 12.742800 20.202000 167.380800 954.355800
>> 68.730800 -3.564065
>>
>> continuing down to:
>>
>> 18122002 23.59 2452627.499930 8.624700 12.121200 171.951600 955.973100
>> 94.427600 -5.265564
>>
>> The first field is the date, second is the time (hr.min), third is the
>> julian for the two first and the rest is the actual data I would like to
>> plot.
>>
>> My problem is that if I do this:
>>
>> plot, data(1,*) ,data(4,*), xstyle=1, /noerase, color=119, $
>> xrange=[0, 24]
>>
>> I get a "chopped" plot at the end of each hour since I "miss" data
>> between ex. 22.59 and 23.00. IDL would like me to have all the steps
>> from 22.60 and up to 22.99 as well.
>>
>> How can I tell IDL that I actually would like to have my xaxis in hours,
>> and that in between the hours I would like to have 60 minutes and not
>> tenths ?

dummy = LABEL_DATE(DATE_FORMAT='%H')
plot, data[2,*], data[4,*], XTICKFORMAT='LABEL_DATE', XTICKUNITS='Hour',
$
XTICKINTERVAL=1, /noerase, color=119

I suspect that the reasons why you were using the XSTYLE and XRANGE
options would no longer apply if you did things this way. However, if
you do provide an XRANGE, you'll need to provide it in Julian Day
format, using the JULDAY function if necessary.

Reading the documentation, I can't figure out what 'dummy' is used for.

For more details, see the online help subject "Date/Time Plotting".
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: PNGs without X?
Next Topic: Re: dialog_pickfile and the 'file' keyword

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

Current Time: Fri Oct 10 11:27:41 PDT 2025

Total time taken to generate the page: 0.79787 seconds