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!!

Ready to join fellow brilliant minds for the SAS Hackathon?

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!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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