Re: Tick labels and dates [message #41834 is a reply to message #41823] |
Wed, 24 November 2004 00:58   |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Michael Wallace wrote:
> I have never been good with figuring how how all the date formatting
> stuff works. I want to label the X axis on a few of my plots with some
> readable date strings. In certain cases, I'd like to display something
> of the form "HH:MI:SS". Other times I'd like to see a day of month or a
> day of year or some other variation.
>
> Anyway, assuming that I have a timestamp in the form of seconds since
> the 1970 epoch, is there some built in way to convert to the time string
> my choosing? Or will I have to role my own conversions? Secondly, how
> do I go about cleanly setting the labels on my IDLgrAxis to the strings?
>
> TIA,
> Mike
Dear Mike
probably this routine from our library could help
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/setup_time_axis_dbase.pro.html
This routine is based on julian seconds. This time format was first
introduced by Ray Sterner (JHUAPL)
If you like to have the right minor ticks for the months over a time
period you should have a look into the minor ticks routine. There is an
example implemented.
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/rb_axis_minor_dbase.pro.html
pro my_plot
x=dindgen(864)*100
y=sin(x/100)
setup_time_axis, x, $
XRANGE = xrange, $
XSTYLE = xstyle,$
XTITLE = xtitle, $
XTICKS = xticks, $
XMINOR = xminor, $
XTICKV = xtickv, $
XTICKNAME = xtickname, $
TIMEFORMAT = 'HH:MM:SS' , $
TIMESTEP = timestep, $
FORCE_10DAYS=1 ,$
xmtickv=xmtickv
plot,x,y,$
XRANGE = xrange, $
XSTYLE = xstyle, $
XTITLE = xtitle, $
XTICKS = xticks, $
XMINOR = xminor, $
XTICKV = xtickv,$
XTICKNAME = xtickname
end
--
Reimar Bauer
Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
============================================================ =======
|
|
|