Changeset 97 for trunk/SRC/Documentation/idldoc_html_output/ToBeReviewed/PLOTS/LABEL/label_date.html
- Timestamp:
- 06/09/06 17:18:59 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Documentation/idldoc_html_output/ToBeReviewed/PLOTS/LABEL/label_date.html
r89 r97 107 107 <span class="result">result = </span>LABEL_DATE(<span class="result"><a href="#_LABEL_DATE_param_axis">axis</a>, <a href="#_LABEL_DATE_param_index">index</a>, <a href="#_LABEL_DATE_param_x">x</a></span>, <a href="#_LABEL_DATE_keyword_DATE_FORMAT">DATE_FORMAT</a>=<span class="result">DATE_FORMAT</span>, <a href="#_LABEL_DATE_keyword_MONTHS">MONTHS</a>=<span class="result">MONTHS</span>, <a href="#_LABEL_DATE_keyword_OFFSET">OFFSET</a>=<span class="result">OFFSET</span>, <a href="#_LABEL_DATE_keyword__EXTRA">_EXTRA</a>=<span class="result">_EXTRA</span>)</p> 108 108 109 <div class="comments"> 110 NAME: 111 LABEL_DATE 112 113 PURPOSE: 114 This function labels axes with dates and times. 115 116 CATEGORY: 117 Plotting. 118 119 CALLING SEQUENCE: 120 To set up: 121 dummy = LABEL_DATE(DATE_FORMAT='string') 122 To use: 123 PLOT, x, y, XTICKFORMAT='LABEL_DATE' 124 125 INPUTS: 126 No explicit user defined inputs. When called from the plotting 127 routines, the input parameters are (Axis, Index, Value) 128 129 KEYWORD PARAMETERS: 130 DATE_FORMAT: a format string which may contain the following: 131 %M for month (3 character abbr) 132 %N for month (2 digit abbr) 133 %D for day of month, 134 %Y for 4 digit year. 135 %Z for last two digits of year. 136 For time: 137 %H for Hours, 2 digits. 138 %I for mInutes, 2 digits. 139 %S for Seconds, 2 digits. 140 %% is %. 141 Other characters are passed directly thru. 142 For example, '%M %D, %Y' prints DEC 11, 1993 143 '%M %2Y' yields DEC 93 144 '%D-%M' yields 11-DEC 145 '%D/%N/%Y' yields 11/12/1993 146 '%M!C%Y' yields DEC on the top line, 1993 on 147 the bottom (!C is the new line graphic command). 148 149 MONTHS: The names of the months, a twelve element string array. 150 If omitted, use Jan, Feb, ..., Dec. 151 152 OFFSET: An optional starting offset of the plot. 153 Unfortunately, single precision floating point is not accurate 154 enough to properly represent Julian times. This offset, which 155 may be double precision, contains an offset that is added to 156 all x values, before conversion to Julian date and time. 157 158 OUTPUTS: 159 The date string to be plotted. 160 161 COMMON BLOCKS: 162 LABEL_DATE_COM. 163 164 RESTRICTIONS: 165 Only one date axis may be simultaneously active. 166 167 PROCEDURE: 168 Straightforward. 169 170 For an alternative way to label a plot axis with dates, refer to 171 the C() format code accepted within format strings (applicable via 172 the [XYZ]TICKFORMAT keywords). This new format code was 173 introduced in IDL 5.2. 174 175 EXAMPLE: 176 For example, to plot from Jan 1, 1993, to July 12, 1994: 177 Start_date = julday(1, 1, 1993) 178 End_date = julday(7, 12, 1994) 179 Dummy = LABEL_DATE(DATE_FORMAT='%N/%D') ;Simple mm/dd 180 x = findgen(end_date+1 - start_date) + start_date ;Time axis 181 PLOT, x, sqrt(x), XTICKFORMAT = 'LABEL_DATE', XSTYLE=1 182 (Plot with X axis style set to exact.) 183 184 Example with times: 185 For example, to plot from 3PM, Jan 1, 1993, to 5AM, Jan 3, 186 1993: 187 Start_date = Julday(1,1,1993) ;Also starting offset 188 Start_time = (3+12)/24. ;Starting_time less offset 189 End_time = (Julday(1,3,1993) - Start_date) + 5./24. ;Ending 190 ;date/time - offset, note that the order of operations is 191 ; important to avoid loss of precision. 192 Dummy = LABEL_DATE(DATE_FORMAT='%D %M!C%H:%I', $ 193 offset=Start_date) ;MMM NN <new line> HH:MM format 194 x = findgen(20) * (End_time - Start_time) / 19 + start_time ;Time axis 195 PLOT, x, sqrt(x), XTICKFORMAT = 'LABEL_DATE', XSTYLE=1 196 197 MODIFICATION HISTORY: 198 DMS, RSI. April, 1993. Written. 199 DMS, RSI. March, 1997. Added Time format.</div> 200 201 202 203 204 <h3>Parameters</h3> 205 206 207 <h4 id="_LABEL_DATE_param_axis">axis 208 209 210 211 212 213 214 215 216 </h4> 217 109 218 <div class="comments"></div> 110 111 112 113 114 <h3>Parameters</h3> 115 116 117 <h4 id="_LABEL_DATE_param_axis">axis 219 220 <h4 id="_LABEL_DATE_param_index">index 118 221 119 222 … … 128 231 <div class="comments"></div> 129 232 130 <h4 id="_LABEL_DATE_param_ index">index 233 <h4 id="_LABEL_DATE_param_x">x 131 234 132 235 … … 141 244 <div class="comments"></div> 142 245 143 <h4 id="_LABEL_DATE_param_x">x 144 145 146 147 148 149 150 151 152 </h4>153 154 <div class="comments"></div>155 156 246 157 247 … … 228 318 229 319 230 231 232 233 234 235 236 320 <h3>Other attributes</h3> 321 322 323 324 325 326 <h4>Common blocks used</h4><div class="value">label_date_com</div> 237 327 238 328
Note: See TracChangeset
for help on using the changeset viewer.