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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.