AXIS Statement The AXIS statements defines the contents, structure, and format of both the horizontal and vertical axes including labels, range of data values, fonts, weights, and values plotted at the major and minor tick marks. The specifications you choose can be many or few. * width of line (larger numbers give heavier weight to line): WIDTH=2 * tickmarks placed between the major tickmarks: MINOR=none * specify your choice of tick marks: ORDER=(0 1 2 3 4) * specify 5 tick marks, 10 units apart: ORDER=40 to 80 by 10 * identify text to be printed at each tick marks specified as 0 1 2 3 4 (rather than the actual numbers): VALUE=(ANGLE=45 COLOR=black HEIGHT=2 ' ' 'short' 'medium' 'tall' ' ' ) * enter text to be printed as the axis label (angle=90 prints a vertical label): LABEL=(Angle=90 Color=black Height=3 "Height (inches)") You can enter several AXIS statements indexed by a number and then invoke the axis number needed. (Note that all AXIS settings disappear whenever the GOPTIONS reset=all; statement is invoked.) The options available on the PLOT statement of GPLOT allow you to specify which AXIS statement is assigned to the vertical axis (VAXIS=axis1) and to the horizontal axis (HAXIS=axis2). One helpful feature of these statements is the sample code below demonstrates how to write distinct values as needed for the tick marks on each axis and not necessarily require you to enter numbers or notate equally spaced values. The following example demonstrates how a few statements can produce a graph to the specifications required for your document. Other helpful statements include NOTE, FOOTNOTE, PATTERN, and FORMAT. You can also annotate the graph with text saved to a dataset in a DATA step and then applied with the annotate option. Example To show how the GOPTIONS, SYMBOL, and AXIS statements all work together to produce a graph with PROC GPLOT, they will be illustrated to produce a scatterplot for two quantitative variables, height (y) and weight (x) from a dataset located in the sashelp directory (on the PC). GOPTIONS reset=all gunit=pct FTEXT=swissb ROTATE=landscape htitle=3 htext=3 CBACK=white ctext=black PAPERSIZE=(11,8.5); AXIS1 COLOR=black LABEL=(c=black h=3 "Weight (Pounds)") WIDTH=2 MINOR=none ORDER=(40 to 160 by 20) VALUE=(COLOR=black HEIGHT=2 ' ' '60 - Light' '80' '100- Moderate' '120' '140-Heavy' ' '); AXIS2 COLOR=black LABEL=(angle=90 COLOR=black HEIGHT=3 "Height (Inches)") WIDTH=2 MINOR=none ORDER=(40 to 80 by 10) VALUE=(COLOR=black HEIGHT=2 ' ' 'Short' 'Medium Short' 'Medium Tall' 'Tall' ' '); SYMBOL1 interpol=none value=star height=2 color=blue; SYMBOL2 interpol=none value=dot height=2 color=red; PROC GPLOT DATA=sashelp.class; PLOT height*weight = sex / NOframe haxis=axis1 VAXIS=axis2; TITLE1 Height=4 "Height vs Weight"; run; quit; PROC GPLOT invokes the plot procedure to produce a two-dimensional scatter plot. The specific dataset is called class contained in the sashelp library. If no dataset is specified, SAS assumes the variables will be found in the dataset produced most recently. PLOT height*weight = sex / ; The PLOT statement specifies which numerical variables to plot. The horizontal axis variable can be character, though coding it as a number allows greater flexibility and ease when making plots. Variable height is placed on the vertical axis and variable weight appears on the horizontal axis. The values of sex will be plotted on the graph itself. The two SYMBOL statements over-ride the actual values and plot what are indicated on them. Two options are requested following the / specify the horizontal axis is HAXIS=axis1 and the vertical axis is specified by VAXIS=axis2 (both statements were defined just prior to the GPLOT step).