Re: How to plot with time as one axis ? [message #33677] |
Sun, 19 January 2003 06:01  |
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  |
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".
|
|
|