proc sgplot data=sashelp.class;
scatter x=height y=weight / group=sex ;
run;
In SAS Studio, I get blue circle for M and red circle for F. Sometimes I can't see if two points are in the same location, as you can see in the following link.
https://support.sas.com/documentation/cdl/en/grstatproc/62603/HTML/default/viewer.htm#a003111460.htm
Ram
With SAS Studio, don't specify the ODS HTML statement like I showed in my code. Just use the STYLEATTRS to set the group marker symbols. The PDF or RTF output should show the different markers. To see different markers in HTML, use ODS GRAPHICS / ATTRPRIORITY=none.
ods graphics / attrpriority=none;
proc sgplot data=sashelp.class;
styleattrs datasymbols=(circlefilled trianglefilled);
scatter x=height y=weight / group=sex ;
run;
With SAS 9.4, you can use the STYLEATTRS statement to specify the group symbols, colors and line patterns.
Note, you need a style like LISTING to see different symbols.
ods html style=listing;
proc sgplot data=sashelp.class;
styleattrs datasymbols=(circlefilled trianglefilled);
scatter x=height y=weight / group=sex ;
run;
Thanks for your reply Sanjay. ODS destination gives some error in SAS Studio.
With SAS Studio, don't specify the ODS HTML statement like I showed in my code. Just use the STYLEATTRS to set the group marker symbols. The PDF or RTF output should show the different markers. To see different markers in HTML, use ODS GRAPHICS / ATTRPRIORITY=none.
ods graphics / attrpriority=none;
proc sgplot data=sashelp.class;
styleattrs datasymbols=(circlefilled trianglefilled);
scatter x=height y=weight / group=sex ;
run;
Hi Sanjay,
Is it possible to use different symbols easily for groups as some of printers can't print color graphs? If we can associate each group with different shape regardless/in addition to the color code, that would be great.
Best Regards,
Kathy Chen
sorry. It worked as we speak. I found the options. Thanks much anyway.
The STYLEATTRS statement can be used to specify the list of colors, symbols and line patters to be used for the groups.
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 16. 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.