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;
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: