Changeset 142 for trunk/SRC/ToBeReviewed/PLOTS/LABEL/label_date.pro
- Timestamp:
- 07/21/06 14:47:49 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/PLOTS/LABEL/label_date.pro
r134 r142 1 ; $Id$2 1 ; 3 2 ; Copyright (c) 1993-1998, Research Systems, Inc. All rights reserved. … … 5 4 6 5 ;+ 7 ; NAME:8 ; LABEL_DATE9 6 ; 10 ; PURPOSE:11 ; 7 ; @file_comments 8 ; This function labels axes with dates and times. 12 9 ; 13 ; CATEGORY:14 ; 10 ; @categories 11 ; Plotting. 15 12 ; 16 ; CALLING SEQUENCE: 17 ; To set up: 18 ; dummy = LABEL_DATE(DATE_FORMAT='string') 19 ; To use: 20 ; PLOT, x, y, XTICKFORMAT='LABEL_DATE' 13 ; @param AXIS {in}{required} 21 14 ; 22 ; INPUTS: 23 ; No explicit user defined inputs. When called from the plotting 24 ; routines, the input parameters are (Axis, Index, Value) 15 ; @param INDEX {in}{required} 25 16 ; 26 ; KEYWORD PARAMETERS: 27 ; DATE_FORMAT: a format string which may contain the following: 28 ; %M for month (3 character abbr) 29 ; %N for month (2 digit abbr) 30 ; %D for day of month, 31 ; %Y for 4 digit year. 32 ; %Z for last two digits of year. 33 ; For time: 34 ; %H for Hours, 2 digits. 35 ; %I for mInutes, 2 digits. 36 ; %S for Seconds, 2 digits. 37 ; %% is %. 38 ; Other characters are passed directly thru. 39 ; For example, '%M %D, %Y' prints DEC 11, 1993 40 ; '%M %2Y' yields DEC 93 41 ; '%D-%M' yields 11-DEC 42 ; '%D/%N/%Y' yields 11/12/1993 43 ; '%M!C%Y' yields DEC on the top line, 1993 on 44 ; the bottom (!C is the new line graphic command). 17 ; @param X {in}{required} 45 18 ; 46 ; MONTHS: The names of the months, a twelve element string array. 47 ; If omitted, use Jan, Feb, ..., Dec. 19 ; @keyword DATE_FORMAT 20 ; a format string which may contain the following: 21 ; %M for month (3 character abbr) 22 ; %N for month (2 digit abbr) 23 ; %D for day of month, 24 ; %Y for 4 digit year. 25 ; %Z for last two digits of year. 26 ; For time: 27 ; %H for Hours, 2 digits. 28 ; %I for mInutes, 2 digits. 29 ; %S for Seconds, 2 digits. 30 ; %% is %. 31 ; Other characters are passed directly thru. 32 ; For example, '%M %D, %Y' prints DEC 11, 1993 33 ; '%M %2Y' yields DEC 93 34 ; '%D-%M' yields 11-DEC 35 ; '%D/%N/%Y' yields 11/12/1993 36 ; '%M!C%Y' yields DEC on the top line, 1993 on 37 ; the bottom (!C is the new line graphic command). 48 38 ; 49 ; OFFSET: An optional starting offset of the plot. 50 ; Unfortunately, single precision floating point is not accurate 51 ; enough to properly represent Julian times. This offset, which 52 ; may be double precision, contains an offset that is added to 53 ; all x values, before conversion to Julian date and time. 54 55 ; OUTPUTS: 56 ; The date string to be plotted. 39 ; @keyword MONTHS 40 ; The names of the months, a twelve element string array. 41 ; If omitted, use Jan, Feb, ..., Dec. 57 42 ; 58 ; COMMON BLOCKS: 59 ; LABEL_DATE_COM. 43 ; @keyword OFFSET 44 ; An optional starting offset of the plot. 45 ; Unfortunately, single precision floating point is not accurate 46 ; enough to properly represent Julian times. This offset, which 47 ; may be double precision, contains an offset that is added to 48 ; all x values, before conversion to Julian date and time. 60 49 ; 61 ; RESTRICTIONS:62 ; Only one date axis may be simultaneously active.50 ; @uses 51 ; LABEL_DATE_COM. 63 52 ; 64 ; PROCEDURE:65 ; Straightforward.53 ; @restrictions 54 ; Only one date axis may be simultaneously active. 66 55 ; 67 ; For an alternative way to label a plot axis with dates, refer to 68 ; the C() format code accepted within format strings (applicable via 69 ; the [XYZ]TICKFORMAT keywords). This new format code was 70 ; introduced in IDL 5.2. 71 ; 72 ; EXAMPLE: 73 ; For example, to plot from Jan 1, 1993, to July 12, 1994: 74 ; Start_date = julday(1, 1, 1993) 75 ; End_date = julday(7, 12, 1994) 76 ; Dummy = LABEL_DATE(DATE_FORMAT='%N/%D') ;Simple mm/dd 77 ; x = findgen(end_date+1 - start_date) + start_date ;Time axis 78 ; PLOT, x, sqrt(x), XTICKFORMAT = 'LABEL_DATE', XSTYLE=1 79 ; (Plot with X axis style set to exact.) 56 ; @examples 57 ; For example, to plot from Jan 1, 1993, to July 12, 1994: 58 ; Start_date = julday(1, 1, 1993) 59 ; End_date = julday(7, 12, 1994) 60 ; Dummy = LABEL_DATE(DATE_FORMAT='%N/%D') ;Simple mm/dd 61 ; x = findgen(end_date+1 - start_date) + start_date ;Time axis 62 ; PLOT, x, sqrt(x), XTICKFORMAT = 'LABEL_DATE', XSTYLE=1 63 ; (Plot with X axis style set to exact.) 80 64 ; 81 65 ; Example with times: … … 92 76 ; PLOT, x, sqrt(x), XTICKFORMAT = 'LABEL_DATE', XSTYLE=1 93 77 ; 94 ; MODIFICATION HISTORY:78 ; @history 95 79 ; DMS, RSI. April, 1993. Written. 96 80 ; DMS, RSI. March, 1997. Added Time format. 81 ; 82 ; Copyright (c) 1993-1998, Research Systems, Inc. All rights reserved. 83 ; Unauthorized reproduction prohibited. 84 ; 85 ; @version 86 ; $Id$ 87 ; 97 88 ;- 98 89 ;----------------------------------------------------------------------------- 99 90 FUNCTION LABEL_DATE, axis, index, x, DATE_FORMAT = format, MONTHS = months, $ 100 91 OFFSET= offs, _EXTRA = ex
Note: See TracChangeset
for help on using the changeset viewer.