Help using Base SAS procedures

Proc Gplot is ignoring symbol2 statement

Posts: 29

Proc Gplot is ignoring symbol2 statement

I am using the following code:

goptions reset=all;
proc gplot data=pred;
plot sales*date=_type_ /
haxis = '1JAN07'd to '1JUL10'd by qtr
href = '15Dec07'd '15Dec08'd '15Dec09'd chref=cyan;
where _type_ in ('ACTUAL','FORECAST');
symbol1 v=star i=none;
symbol2 v=circle i=join;
format date MONYY7.;
run; quit;

When the graph is produced, both 'ACTUAL' and 'FORECAST' series are represented by stars, and there are no connecting lines. 'ACTUAL' is black and 'FORECAST' is red. Essentially, the SYMBOL2 statement is completely ignored. (No matter how I specify symbol1, symbol2 is a copy of it, just in red.)

I have tried changing the placement of the symbol statements, i.e., before the proc gplot statement, to no avail.

Any ideas? Thanks!
Trusted Advisor
Posts: 2,113

Re: Proc Gplot is ignoring symbol2 statement

You need to specify the color on the symbol statement. Otherwise, the _type_ with go through all the colors available to SYMBOL1 before going on to SYMBOL2. It's documented (9.1.3), though not as prominently as one might want:

"Note: The nth generated SYMBOL definition is not necessarily the same as the nth SYMBOL statement. Plot requests of the form y-variable*x-variable=n assign the SYMBOL definition that is designated by n to the plot that is produced by y-variable*x-variable. For more information, see About Plot Requests that Assign a SYMBOL Definition."

Doc Muhlbaier
Posts: 29

Re: Proc Gplot is ignoring symbol2 statement

Hey, it worked! I knew it had to be something incredibly simple. Thanks!!!
Ask a Question
Discussion stats
  • 2 replies
  • 2 in conversation