Hi,
I have the following code from the PCA:
proc sgplot data=princomp;
scatter x=Prin1 y=Prin2/group=cluster ;
xaxis label='Principal component 1';
yaxis label='Principal component 2';
run;
I get the graph that has red and blue empty circles for each cluster. Is there a way I can make them a little bit bigger and/or filled in so that the two clusters can be more easily differentiated when looking at the figure?
Thanks so much!
You can add the MARKERATTRS to override the default size and symbol used by the scatter plot
This would make the size of the marker 10mm, you can specify other units of measure such as CM, IN (inches), PCT (percent of area), PT (printers point like font sizes 72 dots per inch) or PX (pixels). The symbol overrides the default symbol to use a filled circle. The documentation has other choices.
proc sgplot data=princomp; scatter x=Prin1 y=Prin2/group=cluster markerattrs=(size=10mm symbol=circlefilled) ; xaxis label='Principal component 1'; yaxis label='Principal component 2'; run;
There are about 30 symbols, square/ squarefilled, star/ starfilled, triangle/trianglefilled, triangleleft/triangleleftfilled, triangleright/trianglerightfilled, diamond/diamondfilled and homedown/homedownfilled are the "hollow" and "filled" pairs.
If you want to branch into much more control then look up either DATTRMAP data sets or custom ODS Styles.
You can add the MARKERATTRS to override the default size and symbol used by the scatter plot
This would make the size of the marker 10mm, you can specify other units of measure such as CM, IN (inches), PCT (percent of area), PT (printers point like font sizes 72 dots per inch) or PX (pixels). The symbol overrides the default symbol to use a filled circle. The documentation has other choices.
proc sgplot data=princomp; scatter x=Prin1 y=Prin2/group=cluster markerattrs=(size=10mm symbol=circlefilled) ; xaxis label='Principal component 1'; yaxis label='Principal component 2'; run;
There are about 30 symbols, square/ squarefilled, star/ starfilled, triangle/trianglefilled, triangleleft/triangleleftfilled, triangleright/trianglerightfilled, diamond/diamondfilled and homedown/homedownfilled are the "hollow" and "filled" pairs.
If you want to branch into much more control then look up either DATTRMAP data sets or custom ODS Styles.
Perfect, thank you!!
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!
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.
Ready to level-up your skills? Choose your own adventure.