BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Sam_R
Calcite | Level 5

Hi,

 

I'm trying to a sgplot in SAS9.4 which overlays 16 different kernel densities.  Although all kernels are plotted, once it gets beyond 10 colours/line types the lines are all drawn with the same properties.  Does anyone know if there is a maximum number of attributes for overlaid kernels?  Code below if that helps.

 

Thank you in advance!

 

proc sgplot data=graph;
  %do q=1 %to &n;
    %if &&count&q >0 %then %do;
  density &&type.&q / type=kernel name="&q" legendlabel="&&class&q (n=&&count&q)";
    %end;
  %end;
  keylegend / location=outside position=bottom";
  refline 0 / axis=x label="No Change" labelloc=inside labelpos=min lineattrs=(color=black pattern=ShortDash);
  xaxis label="&typelabel &paramlabel";
  yaxis label='Density';
  run;

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

Try setting the CYCLEATTRS option on the SGPLOT statement and see if you get better attribute variations:

 

proc sgplot data=graph cycleattrs;

 

Hope this helps!

Dan

View solution in original post

2 REPLIES 2
DanH_sas
SAS Super FREQ

Try setting the CYCLEATTRS option on the SGPLOT statement and see if you get better attribute variations:

 

proc sgplot data=graph cycleattrs;

 

Hope this helps!

Dan

Sam_R
Calcite | Level 5

Dan - you have just saved me from another couple of hours banging my head against a brick wall. Thank you!

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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
  • 2 replies
  • 692 views
  • 1 like
  • 2 in conversation