BookmarkSubscribeRSS Feed
SAS_User
Calcite | Level 5

Hello,

I am running into this issue and it would be great if someone can help me out.

I am using the following statements:

goptions vsize=5 hsize=7 gunit=pct cback=white horigin=0.5

         ftext=swiss ftitle=swissb htitle=3 htext=3;

symbol value=dot interpol=hilobj;

proc gplot data=all;

plot y * instrument = sample;

run;

Since I have about 30 samples, SAS seems to be running out of colors and after 12 samples, it starts with the same set of colors but now with other symbols. And, most importantly, it is not drawing those lines connecting the samples (across the 3 instruments) once it switches to the different symbol-so I have lines joining the first 12 samples only. Is there a way to make SAS draw the lines for all the samples (i.e. make SAS use only dots and some more colors additional to the first 12)?

Thanks so much for reading!

5 REPLIES 5
GraphGuy
Meteorite | Level 14

Sounds like you'll want to use the 'repeat=' option on your symbol statement, to repeat the marker value= and line interpol= for all ~30 of your samples.  I typically use a repeat number much higher than I actually need, just to be on the safe side.  Here's a short example to get you started...

symbol value=dot interpol=join repeat=100;

proc gplot data=maps.us;
plot y*x=state;
run;

SAS_User
Calcite | Level 5

Thanks so much! I finally had a chance to try that and it worked very well for me. Thanks for your answer

CRMcClure
Calcite | Level 5

Hello,

 

I tried this approach (using SAS Studio in a SAS Grid environment, V3.5 (Enterprise Edition)) with proc gplot and I am successful in getting all of my data represented with a symbol value = dot, but even with the r=100 (for example) option I am still only seeing the same 12 colors repeated over my many series.  Has something changed in since this post (e.g., a new option that I should be choosing) that might solve this issue for me?

 

symbol interpol=join value=dot r=100;

 

Thanks in advance for any guidance,

Chris

GraphGuy
Meteorite | Level 14

CRMcClure - I believe what you are seeing is the expected behavior. In recent versions of SAS, default colors are controlled by ods styles (the default style probably being htmlblue), and I believe the styles have about 12 colors in them. I think in most SAS/Graph procs, once the color list is exhausted, the colors are recycled with a slightly different shade (I forget if it's lighter or darker).

 

But really, once you have more than a few (maybe 5?) colors in a plot ... especially a line plot, I don't think most users will be able to discern them. I would suggest possibly using another strategy to color your lines. I often find that in a plot with a lot of lines, it is often useful to make all the lines a light color, and the the one line-of-interest red. Here's an example:

 

http://robslink.com/SAS/democd89/life_expectancy_healthcare.htm

http://robslink.com/SAS/democd89/life_expectancy_healthcare.sas

 

life_expectancy_healthcare.png

CRMcClure
Calcite | Level 5

Much appreciated, this helped me solve my problem.  Thanks.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 5 replies
  • 2710 views
  • 1 like
  • 3 in conversation