GENERATESCALEPARAMS

From STX Wiki
Jump to navigationJump to search

GENERATESCALEPARAMS

Generate the parameters for a call to SET graph XSCALE or SET graph YSCALE.

Usage:

GENERATESCALEPARAMS min max [ ; [ unit ] ; [ format ] ; [ nLabels ] ; [ nMinorTicks ] ; [ srate ] ]

Parameters:
min max
The minimum and maximum scale values. These parameters are mandatory.
unit
The unit the min and max values are in. The following units are supported:
s - seconds. This is the default unit.
ms - milliseconds
format
The format to use for label creation. The following formats are supported:
clock - the labels are formated as hours, minutes, seconds and milliseconds (HH:MM:SS.TTT). This is the default format.
s - the labels are formated as seconds and the x scale unit text is set to 's'.
ms - the labels are formated as milliseconds and the x scale unit text is set to 'ms'.
samples - the labels are formatted as samples and the x scale unit text is set to 'samples'.
Note that the unit parameter is returned for formats 's' and 'ms', but not for 'clock' or 'samples'.
nLabels
The number of labels to generate. The default is 6.
nMinorTicks
The number of minor ticks to generate. The default is 3.
srate
The sampling rate to use for the 'sample' format.
Result:

The parameters which can be passed to the SET graph XSCALE function:

min max unit title formatStr|table

or an error number.

Examples:
SET $#graph XSCALE $(GenerateScaleParameters $#xmin $#xmax ; s)

This command will generate a time scale using the 'clock' formatting. The values of #xmin and #xmax are in seconds.

Notes:

The scale title is currently not supported and an asterisk is always returned.

Navigation menu

Personal tools