used, in conjunction with the [XYZ]TICKFORMAT keyword to IDL plotting routines, to easily label axes with dates.
This routine is written in the IDL language. Its source code can be found in the file
subdirectory of the IDL distribution.
Result = LABEL_DATE(DATE_FORMAT =
PLOT, x, y, XTICKFORMAT = 'LABEL_DATE'
LABEL_DATE has no explicit inputs. When called from the plotting routines, the input parameters are (
Axis, Index, Value
Set this keyword to a format string that can contain any of the following variables:
%M for month (3 character abbreviations)
%N for month (2 digit abbreviations)
%D for day of month
%Y for 4 digit year
%Z for last two digits of year
%H for hours (2 digits)
%I for minutes (2 digits)
%S for seconds (2 digits)
%% to represent the % character
Any vector font positioning and font change commands
Other characters are passed directly through
'%M %D, %Y'
results in labels of the form
DEC 11, 1993
on the top line,
on the bottom (!C is the newline graphics command).
A twelve element string array that contains the names to be used for months. If omitted, three-letter abbreviations are used (i.e., Jan, Feb, ..., Dec).
The following commands create a sample plot that has a date axis from Jan 1, 1993 to July 12, 1994:
start_date = JULDAY(1, 1, 1993)
end_date = JULDAY(7, 12, 1994)
dummy = LABEL_DATE(DATE_FORMAT = '%N/%D')
x = FINDGEN(end_date+1 - start_date) + start_date
PLOT, x, sqrt(x), XTICKFORMAT = 'LABEL_DATE', XSTYLE=1