BookmarkSubscribeRSS Feed
sassygrl
Calcite | Level 5
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!
2 REPLIES 2
Doc_Duke
Rhodochrosite | Level 12
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
Duke
sassygrl
Calcite | Level 5
Hey, it worked! I knew it had to be something incredibly simple. Thanks!!!

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1974 views
  • 0 likes
  • 2 in conversation