Yes, what you report is true. It has to do with the RTF style being different than modern styles such as the HTML styles. What happens is
When there are two curves, the plot uses the GRAPHFIT and GRAPHFIT2 attributes for the curves.
In an HTML style, GRAPHFIT and GRAPHFIT2 have different colors. But in the RTF style, the colors are similar, but one curve is drawn by using a dashed line. Since you have explicitly set PATTERN=SOLID, the two curves look the same in RTF.
When there are more than two curves, the procedure uses the GRAPHDATA1, GRAPHDATA2, etc, attributes, which give the curves different colors.
There are two workaround. You could delete the PATTERN=SOLID option, but I am assuming you don't want to do this. The second workaround is to modify your macro loop to explicitly use the GRAPHDATA family of attributes, like this:
proc sgplot data=graph CYCLEATTRS;
%do r=1 %to &n;
density &endpoint&r / type=kernel freq=frequency name="&r" legendlabel="&&class&r (n=&&count&r)"
lineattrs=GraphData&r.(pattern=solid thickness=2);
%end;
keylegend /
valueattrs=(Size=7);
yaxis label='Density';
run;
... View more