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 2024

innovate-wordmarks-white-horiz.png

SAS is headed back to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team.

Interested in speaking? Content from our attendees is one of the reasons that makes SAS Innovate such a special event!

Submit your idea!

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 391 views
  • 1 like
  • 2 in conversation