Sets the horizontal (X) units of a series.
SETHUNITS(series, "xunits", col)
series |
- |
Optional. Any series, table, or expression evaluating to a series or table. Defaults to the current Window. |
"xunits" |
- |
A string, the X units. |
col |
- |
Optional. An integer, the column number. Defaults to 1, the first column. |
sethunits("Hz")
sets the horizontal (X) units of the series in the current Window to Hz, or Hertz.
myser = gnorm(1000, 1);
sethunits(myser, "Hz");
sets the horizontal (X) units of the series myser to Hertz.
W1: randn(100, 3);sethunits("Hz", 1);sethunits("m", 2);sethunits("N", 3)
W2: col(w1, 1)
W3: col(w1, 2)
W4: col(w1, 3)
W1 contains a 10x3 random array. The horizontal (X) units of each column are individually set.
W2 contains column 1 of W1 where gethunits(w2) == "Hertz".
W3 contains column 2 of W1 where gethunits(w3) == "Meters".
W4 contains column 3 of W1 where gethunits(w3) == "Newtons".
W1: randn(100, 3);sethunits("Hz", -1)
W2: col(w1, 1)
W3: col(w1, 2)
W4: col(w1, 3)
Similar to above, except all column horizontal units are set to "Hertz."
cumsum(gnorm(1000, 1/3)+.2);setvunits("Price");sethunits("Time");gridhv;griddot

Because the horizontal units are set to "Time", the actual clock time for the series is displayed along the X axis. Use "Real Time" to display clock time with fractional seconds.
See UNITS for a list of supported units.
Compound units are reduced in terms of known supported units. If the unit string is not internally defined (such as lightyears), the string is still assigned to the vertical unit string, but further unit reduction is not performed, however unit expansion (e.g. lightyears^2) will still occur.
Set col to -1 to set the horizontal units of all the columns.
See DEFUNITS to define a unit with a specific expansion.
A series with date/time X units displays tic values in terms of actual calendar or clock time. The starting date and time is determined by the series start date and start time.
The following units are considered date/time units:
Real Time |
Time |
Daily |
Yearly |
Monthly |
Weekly |
Quarterly |
Minutely |
Business Days |