BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
SR79
Fluorite | Level 6

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!  

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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.

View solution in original post

3 REPLIES 3
ballardw
Super User

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.

SR79
Fluorite | Level 6

Perfect, thank you!!

SAS Innovate 2025: Register Now

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!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 663 views
  • 0 likes
  • 3 in conversation