1. Home
  2. AXIS directive

AXIS directive

Defines an oblique axis for high-resolution graphics.

Option

RESET = string token Whether to reset the axis definition to the default values (yes, no); default no

Parameters

IDENTIFIER = identifiers Name to be used inside Genstat to identify each axis
TITLE = texts Title for each axis
TPOSITION = string tokens Position of title (middle, end)
TDIRECTION = string tokens Direction of title (parallel, perpendicular)
LOWER = scalars Lower bound for each axis
UPPER = scalars Upper bound for each axis
MARKS = scalars or variates Distance between each tick mark (scalar) or positions of the marks along each axis (variate)
MPOSITION = string tokens Positioning of the tick marks on each axis (inside, outside, across)
LABELS = texts or variates Labels at each major tick mark
LPOSITION = string tokens Position of the axis labels (inside, outside)
LDIRECTION = string tokens Direction of the axis labels (parallel, perpendicular)
LROTATION = scalars or variates Rotation of the axis labels
NSUBTICKS = scalars Number of subticks per interval (ignored if MARKS is a variate)
XZERO = scalars Position of the axis origin in the x-dimension
YZERO = scalars Position of the axis origin in the y-dimension
ZZERO = scalars Position of the axis origin in the z-dimension
XSTEP = scalars Step in the x-direction corresponding to a step of length one along the axis
YSTEP = scalars Step in the y-direction corresponding to a step of length one along the axis
ZSTEP = scalars Step in the z-direction corresponding to a step of length one along the axis
PENTITLE = scalars Pen to use to write the axis title
PENAXIS = scalars Pen to use to draw the axis
PENLABELS = scalars Pen to use to write the axis labels
ARROWHEAD = string tokens Whether the axis should have an arrowhead (include, omit)
ACTION = string tokens Whether to display or hide the axis (display, hide)
TRANSFORM = string tokens Transformed scale for the axis marks and labels (identity, log, log10, logit, probit, cloglog, square, exp, exp10, ilogit, iprobit, icloglog, root); default iden
DECIMALS = scalars or variates Number of decimal places to use for numbers printed at the marks
DREPRESENTATION = scalars or variates Format to use for dates and times printed at the marks
VREPRESENTATION = string tokens Format to use for numbers printed at the marks

(decimal, engineering, scientific); default deci

SAVE = pointers Saves details of the current settings for the axis concerned

Description

The AXIS directive allows you to define an oblique axis for high-resolution graphics. You use the IDENTIFIER parameter to supply an identifier to store the axis definition. You can then use this as a setting of the AXES parameter of the FRAME directive to display the axis in a particular graphics window. The other parameters define particular attributes of the axis. Any that are not set in a particular AXIS statement retain their existing settings. These may be the initial default settings, which are the same as those of other (x-, y- or z-) axes, or they may have been defined by an earlier AXIS statement with the same axis identifier. Alternatively, you can set option RESET=yes to reset the values back to the initial default values.

The position of the axis origin in the x-, y- and z-dimensions of the window is specified by the parameters XZERO, YZERO and ZZERO, respectively. The XSTEP, YSTEP and ZSTEP parameters define the size of the steps in the x-, y- and z-directions that corresponds to a step of length one along the axis. These six parameters thus define the location and direction of the axis.

You can specify a title for the axis using the TITLE parameter. This is limited to a single line of characters. The TPOSITION parameter controls whether the title is placed in the middle or at the end of the axis, and the TDIRECTION parameter controls whether it is written parallel or perpendicular to the axis.

The LOWER and UPPER parameters specify the lower and upper bounds for the axis. By default, Genstat sets the axis bounds so that the axis goes from one side of the window to the other.

The axis is marked with a scale, determined automatically so that tick marks are evenly spaced and positioned to give “round” numbers for the scale values. You can set the MARKS parameter to a scalar to define the increment between tick marks. For example, setting MARKS=1.5 with bounds 10 and 2, causes tick marks to appear at 2, 3.5, 5, 6.5, 8 and 9.5. The interval must be a positive number, irrespective of the values of the bounds. Alternatively, you can set MARKS to a variate (with more than one value) to specify the actual positions of the tick marks on the axis. Any values that lie outside the axis bounds are ignored. The scale values printed next to the tick marks use a format that is determined automatically from the values, but if you set MARKS to a variate it will use the number of decimals specified in the variate declaration. If MARKS is unset or set to a scalar, you can use the NSUBTICKS parameter to specify a number of “subticks” to be drawn between each of the (major) tick marks.

When you set MARKS, you can also use the LABELS parameter to specify a set of labels to print at the (major) axis marks, instead of the numbers. For example,

TEXT [VALUES=Mon,Tues,Wed,Thur,Fri,Sat,Sun] Day

VARIATE [VALUES=1...31] Month

AXIS Timeax; MARKS=Month; LABELS=Day

The strings within the text are cycled if necessary, so the number of strings can be less than the number of tick marks. The DECIMALS parameter can set the number of decimal places to use if you are printing numbers at the marks. If the numbers represent dates or times, you should specify their formats using the DREPRESENTATION parameter (see the PRINT directive for details). By default, numbers are printed in decimal form. If you would prefer scientific format you can set parameter VREPRESENTATION=scientific; numbers are then printed as a decimal number with absolute value less than 10, followed by an exponent (e.g. 3.4567 E4 for 34567). Alternatively, you can set VREPRESENTATION=engineering to use engineering format; the decimal number then has an absolute value less than 10000, so the exponent is a multiple of 3 (e.g. 34.567 E3 for 34567). With scientific or engineering formats, the DECIMALS parameter sets the number of significant figures to use rather than the number of decimal places.

The MPOSITION parameter controls the positioning of the tick marks, which can be drawn on the inside or the outside of the axis, or can be drawn across the axis. With the outside setting, the tick marks are drawn towards the outside of the plot; that is below the axis if the axis is in the lower half of the plot, or above the axis if it is in the top half of the plot. The aim is then to position the tick marks away from the main part of the plot, so that they interfere with the plotted points as little as possible. With the inside setting, the marks are drawn on the opposite side (that is, to the inside of the plot), while the across setting draws them across the axis. Similarly, the positioning of the scale markings or labels is controlled by the LPOSITION parameter, with settings inside or outside. The LDIRECTION parameter controls whether the scale markings or labels are written parallel or perpendicular to the axis. Alternatively, you can use the LROTATION parameter to specify the direction of the labels more precisely, as a rotation in degrees from the horizontal (i.e. parallel) direction. If LROTATION is specified, any setting of LDIRECTION is ignored.

Setting MARKS=* will return to the default positioning of the tick marks. Setting LABELS=* will switch off any labels previously specified. Setting MPOSITION=* will switch off any tick marks, and setting LPOSITION=* or LDIRECTION=* will switch off any labels.

The TRANSFORM parameter allows you to transform the marks and labels on the axis. The location and direction of the axis are defined according to the original scale, by the XZERO, YZERO, ZZERO, XSTEP, YSTEP and ZSTEP parameters, as usual. The coordinates along the axis are then transformed, and labelled according to the transformed scale. So, for example, with TRANSFORM=log10, the original coordinates 1, 10 and 100 would be labelled 0, 1 and 2. The settings are the same as the names of the equivalent Genstat functions, with the addition of exp10 for the antilog transformation (i.e. 10x), and square for x2.

There are three parameters to control the pens to be used to draw the axis. These are PENTITLE, PENAXIS and PENLABEL, specifying the pen for the title, the axis and the labelling, respectively. The initial default is to use pens -1, -2 and -3 as for other axes.

The ARROWHEAD parameter controls whether the axis is drawn with an arrowhead at the end. The ACTION parameter controls whether or not the axis is displayed or hidden initially when the window is used for a plot (you can then choose to display the axis from within the graphics viewer).

The current settings defined for the axis can be saved in a pointer supplied by the SAVE parameter. The elements of the pointer are labelled to identify the components.

Option: RESET.

Parameters: IDENTIFIER, TITLE, TPOSITION, TDIRECTION, LOWER, UPPER, MARKS, MPOSITION, LABELS, LPOSITION, LDIRECTION, LROTATION, NSUBTICKS, XZERO, YZERO, ZZERO, XSTEP, YSTEP, ZSTEP, PENTITLE, PENAXIS, PENLABELS, ARROWHEAD, ACTION, TRANSFORM, DECIMALS, DREPRESENTATION, VREPRESENTATION, SAVE.

See also

Directives: XAXIS, YAXIS, ZAXIS, FRAME.

Commands for: Graphics.

Example

" AXIS example - plot a 30/60/90 set square "
AXIS   lower; LOWER=0; UPPER=2; MARKS=0.5; XZERO=1; YZERO=1;\
       XSTEP=1; YSTEP=0
AXIS   oblique; LOWER=0; UPPER=4; MARKS=0.5; MPOSITION=inside;\
       LPOSITION=inside; XZERO=1; YZERO=1; XSTEP=COS(RADIANS(60));\
       YSTEP=SIN(RADIANS(60))
AXIS   upper; LOWER=0; UPPER=SQRT(16-4); MARKS=0.5; XZERO=3; YZERO=1;\
       XSTEP=0; YSTEP=1
XAXIS  1; LOWER=0; UPPER=5
YAXIS  1; LOWER=0; UPPER=5
FRAME  1; AXES=!p(lower,oblique,upper)
DGRAPH [KEY=0] 1; 1
Updated on June 20, 2019

Was this article helpful?