Re: Time axis labelling (1 major label every 7 days with 6 minor ticks) [message #60348] |
Mon, 19 May 2008 03:12 |
Foldy Lajos
Messages: 268 Registered: October 2001
|
Senior Member |
|
|
On Mon, 19 May 2008, Patrique wrote:
> Dear all,
>
> I'm currently trying to figure out how to make IDL to draw a time axis
> reaching from 14 Jan to 18 Feb 2008 (exactly 5 weeks) with major ticks
> each 7 days and 6 minor ticks in between so that there is a tick label
> each full week. I already tried a lot of different things, but nothing
> really worked. In my IDL Version (6.4) even the spacing of the tick
> marks varies along the x axis when running the example below.
>
> Can someone of you give me any hint on how to manage this issue ?
>
> pro test
> ;xaxis: start on 14 Jan, end on 18 Feb
> time = FINDGEN(36)+JULDAY(01,14,2008,00,00)
> ;yaxis values
> Values = RANDOMN(seed,36)
>
> ;axis formatting
> !X.TICKFORMAT = ['LABEL_DATE']
> !X.TICKUNITS =['Time']
> dummy=LABEL_DATE(DATE_FORMAT = '%D.%N.%Y!C%H:%I')
>
> ;plotting
> PLOT,time,values, XSTYLE=1, YSTYLE=1, XTICKS=5
> end
>
> Best regards and thanks for your help,
> Patric.
>
Do it manually. it takes much less time :-)
(if you need this only once)
pro test
;xaxis: start on 14 Jan, end on 18 Feb
time = FINDGEN(36)
;yaxis values
Values = RANDOMN(seed,36)
;plotting
PLOT,time,values, XSTYLE=1, YSTYLE=1, XTICKS=5,
xtickname=['14-jan-2008!C12:00', $
'21-jan-2008!C12:00', $
'28-jan-2008!C12:00', $
'04-feb-2008!C12:00', $
'11-feb-2008!C12:00', $
'18-feb-2008!C12:00'],$
xminor=7
end
regards,
lajos
|
|
|