axis Guide Type (GPL)

Syntax

axis(dim(<numeric>), <function>)

or

axis(scale(<scale name>), <function>)

<numeric>. A numeric value indicating the dimension to which the scale applies. See the topic dim Function (GPL) for more information.

<function>. One or more valid functions. Use the null() function to hide the axis.

<scale name>. The name of the scale to which the axis applies. See the topic scale Function (For GPL Axes) for more information.

Description

Specifies the axis for a particular dimension. Do not confuse the axis with the scale. They are separate parts of the graph and are handled with separate GPL statements. The axis helps interpret the scale with labels and tick marks, but the axis does not change the positioning of graphic elements as changing the scale would. For information about scales, see SCALE Statement (GPL).

Examples

Figure 1. Example: Specifying an axis label for a dimension with one scale
GUIDE: axis(dim(2), label("Mean Current Salary"))
Figure 2. Example: Specifying axis labels for a dimension with two scales
SCALE: y1 = linear(dim(2))
SCALE: y2 = linear(dim(2))
GUIDE: axis(scale(y1), label("Mean Salary"))
GUIDE: axis(scale(y2), label("Count"), opposite(), color(color.red))