本文共 10418 字,大约阅读时间需要 34 分钟。
Accepted by: , , , , . System variable equivalents: ![XYZ].CHARSIZE.
The size of the characters used to annotate the axis and its title when Hershey fonts are selected. This keyword does not apply when hardware (i.e. PostScript) fonts are selected. This field is a scale factor applied to the global scale factor set by !P.CHARSIZE or the keyword CHARSIZE.
Accepted by: , , , , . System variable equivalent: !P.TICKLEN.
Controls the length of the axis tick marks, expressed as a fraction of the window size. The default value is 0.02. TICKLEN of 1.0 produces a grid, while a negative TICKLEN makes tick marks that extend outside the window, rather than inwards. A value of -0.02 makes tick marks that extend away from the plot. Individual axis ticks can be controlled with the keyword.
For example, to produce outward-going tick marks of the normal length:
, X, Y, TICKLEN = -0.02
To provide a new default tick length, set !P.TICKLEN.
Accepted by: , , , , . System variable equivalent: ![XYZ].THICK.
This keyword controls the thickness of the lines forming the x, y, or z axes and their tick marks. A value of 1.0 is the default.
Accepted by: , , , , .
A named variable in which to return the values of the tick marks for the designated axis. The result is a double precision floating-point array with the same number of elements as ticks.
For example, to retrieve in the variable V the values of the tick marks selected by IDL for the Y axis:
, X, Y, YTICK_GET = V
Accepted by: , , , , .
variable equivalent: ![XYZ].TICKINTERVAL
Set this keyword to a scalar indicating the interval between major tick marks for the first axis level. The default value is computed according to the axis range ([XYZ]RANGE) and the number of major tick intervals ([XYZ]TICKS). This keyword takes precedence over [XYZ]TICKS.
For example, if TICKUNITS=[“Seconds”, “Hours”, “Days”], and XTICKINTERVAL=30, then the interval between major ticks for the first axis level will be 30 seconds.
Accepted by: , , , , . System variable equivalent: ![XYZ].TICKLAYOUT.
Set this keyword to a scalar that indicates the tick layout style to be used to draw each level of the axis.
Valid values include:
Note: For all tick layout styles, at least one tick label will appear on each level of the axis (even if no major tick marks fall along the axis line). If there are no major tick marks, the single tick label will be centered along the axis.
Accepted by: , , , , . System variable equivalent: ![XYZ].TICKLEN.
This keyword controls the lengths of tick marks (expressed in normal coordinates) for the individual axes. This keyword, if nonzero, overrides the global tick length specified in !P.TICKLEN, and/or the keyword parameter, which is expressed as a fraction of the window size in the tick mark’s direction.
Accepted by: , , , , . System variable equivalent: ![XYZ].TICKNAME.
A string array of up to 30 elements that controls the annotation of each tick mark. If omitted or if a given string element contains an empty string, IDL labels the tick mark with its value. To suppress the tick labels, supply a string array of one-character long, blank strings, i.e., REPLICATE(' ', N). Empty strings force IDL to number the tick mark with its value.
Note: If there are n tick-mark intervals, there are n + 1 tick marks and labels.
Accepted by: , , , , . System variable equivalent: ![XYZ].TICKS.
The number of major tick intervals to draw for the axis. If this keyword is set to zero or omitted, IDL selects from three to six tick intervals. Setting this value to n, where n > 1, produces exactly n tick intervals, and n+1 tick marks. Setting this value equal to 1 suppresses major tick marks. (Set =1 to suppress minor tick marks.)
Accepted by: , , , , . System variable equivalent: ![XYZ].TICKUNITS.
Set this keyword to a string or a vector of strings indicating the units to be used for axis tick labeling. If a vector of strings is provided, the axis will be drawn in multiple levels, where each string represents one level in the specified units.
Note: When creating multiple-level axes, you may need to adjust the plot positioning using the or keywords in order to ensure that axis labels and titles are visible in the plot window.
The order in which the strings appear in the vector determines the order in which the corresponding unit levels will be drawn. The first string corresponds to the first level (the level nearest to the primary axis line).
Valid unit strings include:
If any of the time units are utilized, the tick values are interpreted as Julian date/time values.
Note that the singular form of each of the time value strings is also acceptable (e.g, TICKUNITS='Day' is equivalent to TICKUNITS='Days').
Note: Julian values must be in the range -1095 to 1827933925, which corresponds to calendar dates 1 Jan 4716 B.C.E. and 31 Dec 5000000, respectively.
Accepted by: , , , , . System variable equivalent: ![XYZ].TICKV.
The data values for each tick mark, an array of up to 60 elements. You can directly specify these values, producing graphs with arbitrary tick marks. If you do this, IDL scales the axis from the first tick value to the last unless you directly specify a range.
Note: To specify the number of ticks and their values exactly, set [XYZ]TICKS=N(where N > 1) and [XYZ]TICKV=Values, where Values has N+1 elements.
Accepted by: , , , , . System variable equivalent: ![XYZ].TICKFORMAT.
Set this keyword to a string or a vector of strings. The string can be a format string or a string containing the name of a function that returns a string to be used to format the axis tick mark labels. If a vector is provided, each string corresponds to a level of the axis. The keyword determines the number of levels for an axis.
Each string is one of the following:
If the string begins with an open parenthesis, it is treated as a standard format string. See for more information on format codes.
Example 1: Display the X axis tick values using a format of F6.2 (six characters, with 2 places after the decimal point):
, X, Y, XTICKFORMAT='(F6.2)'
Example 2: Display the Y tick values using the “dollars and cents” format $dddd.dd:
, X, Y, YTICKFORMAT='("$", F7.2)'
Set [XYZ]TICKFORMAT to the string 'LABEL_DATE' to create axes with date labels. The formatting of the labels is specified by first calling with the DATE_FORMAT keyword.
Example: Use the function as the callback function to display the X tick values in a date/time format:
dummy = (DATE_FORMAT='%M %Z')
mytimes = (12, UNITS='MONTHS', START=(1,1,2000))
y = (12)
, mytimes, y, XTICKUNITS='Time', XTICKFORMAT='LABEL_DATE'
See the section of LABEL_DATE for more extensive examples.
If the string does not begin with an open parenthesis, it is interpreted as the name of a callback function to be used to generate tick mark labels. This function is defined with either three or four parameters, depending on whether [XYZ]TICKUNITS is specified:
If [XYZ]TICKUNITS is not specified, the callback function is called with three parameters, Axis, Index, and Value, where:
Note: Value is a double-precision floating-point value that represents the Julian date. The Julian date follows the astronomical convention, where Julian date 0.0d corresponds to 1 Jan 4713 B.C.E. at 12 pm.
If [XYZ]TICKUNITS is specified, the callback function is called with four parameters, Axis, Index, Value, and Level, where:
Example 1: Use a callback function to display the Y tick values as a percentage of a fixed value. Note that because we don’t specify [XYZ]TICKUNITS, we do not include the Level parameter in our function definition:
YTICKS, , index, value
fixvalue = 389.0d
pvalue = (value/fixvalue) * 100.0d
, (pvalue, FORMAT='(D5.2,"%")')
use_callback
Y = (10)
, Y, YTICKFORMAT='YTICKS'
Example 2: Create a two-level X axis. Display the X tick values in a customized date/time format that shows the number of days open for business for each month on one level, and marks leap years with an asterisk on another level:
XTICKS, , index, value, level
level OF
0: ; months
; Number of days open for business in given month:
, value, month
open = [18,19,23,20,22,22,19,10,20,21,22,14]
nbdays = open[month]
; Return a string containing the month name plus
; the number of business days in parentheses:
, (value, nbdays, $
FORMAT='(C(CMoA), "(", I2, ")")')
1: ; years
; Generate a string for the year.
yrStr = (value, FORMAT='(C(CYI))')
; Determine if a leap year. If so,
; append an asterisk to the string.
, value, mo, da, yr
(yr 4 0)
(yr 100 0) $
isLeap = (yr 400) 0 $
$
IsLeap = 1b
$
isLeap = 0b
(isLeap 0b) $
yrStr = yrStr + '*'
, yrStr
plot_sales
myDates = (12, UNITS='Months', START=(1,1,2000))
sales = [180,190,230,200,220,220,190,100,200,210,220,140]
, myDates, sales, XTICKUNITS=['Months', 'Years'], $
XTICKFORMAT='XTICKS', XTITLE = 'Date (* = Leap Year)', $
YTITLE='Sales (units)', POSITION = [0.2, 0.2, 0.9, 0.9]
转载地址:http://dviqb.baihongyu.com/