1. Home
  2. ZAXIS directive

ZAXIS directive

Defines the z-axis in each window for high-resolution graphics.


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


WINDOW = scalars Numbers of the windows
TITLE = texts Title for the axis
TPOSITION = string tokens Position of title (middle, end)
TDIRECTION = string tokens Direction of title (parallel, perpendicular)
LOWER = scalars Lower bound for axis
UPPER = scalars Upper bound for axis
MARKS = scalars or variates Distance between each tick mark (scalar) or positions of the marks along the axis (variate)
MPOSITION = string tokens Positioning of the tick marks on the 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)
XORIGIN = scalars Position on x-axis at which the axis is drawn
YORIGIN = scalars Position on y-axis at which the axis is drawn
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)
MLOWER% = scalars How large a margin to set between the lowest z-value and the lower value of the axis, if not set explicitly by LOWER (expressed as a percentage of the range of the z-values)
MUPPER% = scalars How large a margin to set between the largest z-value and the upper value of the axis, if not set explicitly by UPPER (expressed as a percentage of the range of the z-values)
DECIMALS = scalars or variates Number of decimal places to use for numbers printed at the marks
DREPRESENTATION = scalars, variates or texts 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
XOMETHOD = string tokens Method to use to set the position of the origin on the x-axis if not set explicitly by XORIGIN (upper, lower, center, centre)
YOMETHOD = string tokens Method to use to set the position of the origin on the y-axis if not set explicitly by YORIGIN (upper, lower, center, centre)
REVERSE = string tokens Whether to reverse the axis direction to run from upper to lower instead of the default lower to upper (yes, no); default no
SAVE = pointers Saves details of the current settings for the axis concerned


There is a definition for the z-axis associated with each Genstat graphics window. This specifies how the z-axis is to be drawn when three-dimensional graphical output is produced in that window. The default definition for each axis requires some of the features to be determined from the data. Others have fixed defaults that are independent of the data. The ZAXIS directive can be used to override the default action and specify particular aspects of the z-axis explicitly. (Similarly, directives XAXIS and YAXIS modify the x- and y-axis definitions, respectively.) All parameters of ZAXIS are relevant when using D3GRAPH, but for other directives only some of the parameters are used. The syntax of ZAXIS is identical to that of XAXIS, except that ZAXIS has an XORIGIN parameter instead of the ZORIGIN parameter of XAXIS.

The WINDOW parameter specifies the window whose axis definition is to be altered. WINDOW can be set to a list of window numbers, in which case the other parameter lists are cycled in parallel, in the usual way. By default, only those aspects specified by subsequent parameter lists are modified; any parameters that are not set will retain their current settings. Alternatively, you can specify option RESET=yes to reset the values of any parameters that are not set for each window, back to the default values that are set up by Genstat at the start of a job.

As in XAXIS, the LOWER, UPPER, MLOWER% and MUPPER% parameters can specify the lower and upper bounds for the axis, the REVERSE parameter can reverse the axis, and the TITLE, TPOSITION and TDIRECTION parameter can define a title for the axis.

The XORIGIN parameter determines the value on the x-axis through which the axis is drawn. If its value is outside the x-axis bounds, the upper or lower bound is adjusted so that the axis will extend up to the specified origin. This applies whether you have set the bounds explicitly or have left Genstat to calculate them from the data. If XORIGIN is not set, the XOMETHOD parameter can specify how the position should be determined: either at the upper value on the x-axis, or the lower value, or in the centre. The initial default (if neither of these parameters has been specified) is to put the axis at the lower end, which will be the lower value unless the scale is reversed. The YORIGIN and YOMETHOD parameters set the position of the origin on the y-axis in a similar way, with the initial default that the axis is at the bottom of the y-axis.

As in XAXIS, the MARKS, NSUBTICKS, LABELS, DECIMALS, DREPRESENTATION and VREPRESENTATION parameters specify the markings on the axis, and their associated labels. The MPOSITION, LPOSITION, LDIRECTION and LROTATION parameters control the positioning of the tick marks and labels. The ARROWHEAD parameter again controls whether the axis is drawn with an arrowhead at the end, and parameters PENTITLE, PENAXIS and PENLABEL specify the pen to be used for the title, the axis and the labelling, respectively. ACTION allows you to hide the axis, and SAVE allows you to save the current settings defined for the axis. Full details of all these parameters are given in the description of XAXIS.

Option: RESET.


See also


Procedure: DHELP.

Commands for: Graphics.


" Example DSUR-1: Surface and shade plot of a trig function "

"Create data on a regular 101 x 101 grid for trig Function"
SCALAR    N; 101
&         [ROWS=1; COLUMNS=N] Y; VALUES=!(1...N)
CALCULATE Z = 2 * SIN(SQRT(((X - (N+1)/2) *+ ROW1(N)/6)**2\
              + (COL1(N) *+ (Y - (N+1)/2) / 6)**2))**2\
              /(4 + SQRT(((X - (N+1)/2) *+ ROW1(N) / 10)**6\ 
                + (COL1(N) *+ (Y - (N+1)/2) / 10)**6))

" Draw a surface plot "
FRAME     [RESET=yes] 3
XAXIS     [RESET=yes] 3; TITLE = 'X'
YAXIS     [RESET=yes] 3; TITLE = 'Y'
ZAXIS     [RESET=yes] 3; TITLE = 'Z'
PEN       [RESET=yes] 3
DSURFACE  [TITLE='Surface plot of a trig function'; WINDOW=3; KEY=0] Z; PEN=3

" Draw a shade plot "
FRAME     [RESET=yes] 1
XAXIS     [RESET=yes] 1; TITLE = 'X'
YAXIS     [RESET=yes] 1; TITLE = 'Y'
PEN       [RESET=yes] 1; COLOUR='red'
PEN       [RESET=yes] 2; COLOUR='blue'
DSHADE    [TITLE='Shade Plot of trig function'; GRID=*] Z; PEN=!(1,2)
Updated on October 28, 2020

Was this article helpful?