Language Reference

GXAXIS and GYAXIS Calls

draw a horizontal or vertical axis

CALL GXAXIS( starting-point, length, nincr <, nminor<, noticklab>
           <, format<, height<, font<, color<, fixed-end>
           <, window<, viewport>);
CALL GYAXIS( starting-point, length, nincr <, nminor<, noticklab>
           <, format<, height<, font<, color<, fixed-end>
           <, window<, viewport>);

The inputs to the GXAXIS and GYAXIS subroutines are as follows:
starting-point
is the (x,y) starting point of the axis, specified in world coordinates.

length
is a numeric scalar giving the length of the axis.

nincr
is a numeric scalar giving the number of major tick marks on the axis.

nminor
is an integer specifying the number of minor tick marks between major tick marks.

noticklab
is a flag that is nonzero if the tick marks are not labeled. The default is to label tick marks.

format
is a character scalar that gives a valid SAS numeric format used in formatting the tick-mark labels. The default format is 8.2.

height
is a numeric matrix or literal that specifies the character height. This is used for the tick-mark labels.

font
is a character matrix or quoted literal that specifies a valid font name. This is used for the tick-mark labels.

color
is a valid color. The color argument can be specified as a quoted text string (such as 'RED'), the name of a character matrix containing a valid color as an element, or a color number (such as 1). A color number n refers to the nth color in the color list.

fixed-end
holds one end of the scale fixed. U fixes the upper end; L fixes the lower end; X allows both ends to vary from the data values. In addition, you can specify N, which causes the axis routines to bypass the scaling routine. The interval between tick marks is length divided by (nincr-1). The default is X.

window
is a numeric matrix or literal specifying a window. This is given in world coordinates and has the form

 {minimum-x minimum-y maximum-x maximum-y}


viewport
is a numeric matrix or literal specifying a viewport. This is given in normalized coordinates and has the form

 {minimum-x minimum-y maximum-x maximum-y}

The GXAXIS subroutine draws a horizontal axis; the GYAXIS subroutine draws a vertical axis. The first three arguments are required.

The starting-point argument is a matrix of two numbers given in world coordinates. The matrix is the (x,y) starting point of the axis.

The length argument is a scalar value giving the length of the x axis or y axis in world coordinates along the x or y direction.

The nincr argument is a scalar value giving the number of major tick marks shown on the axis. The first tick mark is on the starting point as specified.

The axis routines use the same scaling algorithm as the GSCALE subroutine. For example, if the x starting point is 10 and the length of the axis is 44, and if you call the GSCALE subroutine with the x vector containing the two elements, 10 and 44, the scale obtained should be the same as that obtained by the GXAXIS subroutine. Sometimes, it can be helpful to use the GSCALE subroutine in conjunction with the axis routines to get more precise scaling and labeling.

For example, suppose you want to draw the axis for -2 \leq x \leq 2 and -2 \leq y \leq 2. The following code draws these axes. Each axis is 4 units long. Note that the x axis begins at the point (-2,0) and the y axis begins at the point (0,-2). The tick marks can be set at each integer value, with minor tick marks in between the major tick marks. The noticklab option is turned off, so that the tick marks are not labeled.

  
    call gport({20 20 80 80}); 
    call gwindow({-2 -2 2 2}); 
    call gxaxis({-2,0},4,5,2,1); 
    call gyaxis({0,-2},4,5,2,1);
 

Previous Page | Next Page | Top of Page