I'm using proc sgplot and I would like a dark solid line over a fairly transparent scatter plot. Can I adjust the transparency for the line/markers individually?
It seems you that you can't put 'transparency' inside either set of parentheses.
proc sgplot data=mydata; reg y=hrs x=days / lineattrs=(thickness=4 color=red) markerattrs=(symbol=circlefilled size=6) transparency=0.85; yaxis grid values=(0 to 1800 by 100) label="ylabel"; xaxis label="xlabel"; run;
I might suggest two REG statements. One with the markers and transparency you want , the second with the line attributes you want and the NOMARKERS option.
The order of the REG statements will have some impact so I suspect the first should be the one with markers and the second the one without markers so the line draws over the previous line.
I might suggest two REG statements. One with the markers and transparency you want , the second with the line attributes you want and the NOMARKERS option.
The order of the REG statements will have some impact so I suspect the first should be the one with markers and the second the one without markers so the line draws over the previous line.
You could overlap scatter points or line to make it happen.
proc sgplot data=sashelp.heart;
scatter y=height x=weight/markerattrs=(symbol=circlefilled size=6) transparency=0.85;
reg y=height x=weight / lineattrs=(thickness=4 color=red ) nomarkers;
yaxis grid label="ylabel";
xaxis label="xlabel";
run;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.