SYMBOL Statement The SYMBOL statement specifies how plotting symbols are displayed on the graph. They define: * the appearance of symbols and lines plotted on the graph, including data displayed as points, lines, bars, specific colors, boxes, and the confidence interval limits to name a few * dots or lines: interpolation methods (i.e., how to connect or to not connect the points) * how to handle data out of range When you specify new or change existing SYMBOL definitions, they are automatically applied to the next graph produced by the GPLOT procedure. If you do not enter a SYMBOL statement, GPLOT applies default values for the plot as needed. If a SYMBOL statement is already in effect, it will apply to the next GPLOT step, so you should reset graphical options to their default values before you submit symbol statements for a new graph. You can also overlay plots of two or more pairs of variables on the same graph. When this occurs you should enter a separate SYMBOL statement for each pair of variables and index it by a number. For example, to plot the first variable, SYMBOL statement number 1 will be defined as: SYMBOL1 value=dot height=3 interpol=join line=2 color=red width=2; ^ ^^^ ^ ^^^^ ^ ^^^ ^ In this statement note that: * the "1" at the end of the SYMBOL keyword means to assign the options that follow to the first sorted variable name that is to be plotted * value=star means to plot a star * as the symbol on the graph * height=3 specifies a relatively "larger" size of the chosen symbol * interpol=join tells SAS to connect the plotted points with a line type 2 (dashed) * color=red prints the dots and the line red note that the CSYMBOL option in the GOPTIONS statement will specify one specific color, you can then differentiate lines with the line=option * width=2 makes the line thicker (than the default value of 1) SYMBOL1 value='C' h=2 font=marker i=join line=33 color=black; This SYMBOL statement applies the letter C to the plotted points which are connected by a line of type 33 (faint dashed line). You can also include options in the SYMBOL1 statement used above to superimpose a linear regression line with 99% confidence limits for the predicted values: SYMBOL1 value=star height=2 interpol=rlcli99 width=2 line=5; * interpol=rlcli99 means to add a linear regression line (rl) to the scatter plot and to print upper and lower confidence limits for the individual predicted values (cli) at 99% (99) * width=2 sets the width of interpolation line * line=5 requests the line be printed as type 5 (out of 46 possible line types) Symbol statements can be applied to plots based on the values of a variable in the dataset, or numbers supplied on the PLOT statements. For example, Symbol1 value=triangle i=none color=blue; Symbol2 value=plus i=spline color=green; Symbol3 value=diamond i=none color=blue; PROC GPLOT; PLOT y * x=1 pred_y*x=2 / overlay; PLOT resid * pred_y=3 / vref=0; RUN; SYMBOL statements indexed by 1 and 2 are applied to the first PLOT statement; SYMBOL statement with index 3 is applied to the second. You can also assign SYMBOL statements based on the value of a variable, such as treatment (trt = A,B,C), to specify a different color for each treatment: GOPTIONS reset=all cback=white; SYMBOL1 value=dot i=hilo c=blue; SYMBOL2 value=dot i=hilo c=red; SYMBOL3 value=dot i=hilo c=purple; PROC GPLOT; PLOT rsp*xplot=trt / NOframe Nolegend haxis = 0 to 4 by 1; RUN; QUIT; Symbol statements map their respective definitions to the variable names in the sorted order of the vertical axis variables: Symbol1 i=none value=dot h=1 color=red ; Symbol2 i=none value=square h=2 color=blue ; Proc Gplot Data = indat ; PLOT ( x y ) * z / NOframe OverLay ; Run ; Quit ; In this example Symbol1 maps red dots of h=1 for values of x versus z because x comes before y in the sorted order; likewise, symbol2 maps blue squares of size h=2 to y. Symbol1 color = Red ; Symbol2 color = Blue ; Proc Gplot Data = indat ; Plot ( x a ) * z / NOframe OverLay ; Run ; Quit ; Here variable A comes before variable X in their sorted order so Symbol1 will map to A while Symbol2 will map to X. You can also apply a format to the =variable on the PLOT statement to refer to the respective SYMBOL statement you want each level. PROC GPLOT DATA=indat; PLOT y*x=group / NOframe; FORMAT group grp. ; Run; More information about how to apply the SYMBOL statement can be found at: http://sas.uoregon.edu/sashtml/gref/zbolchap.htm#z0751130