BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Ram_SAS
Obsidian | Level 7

 

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
Jay54
Meteorite | Level 14

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;

View solution in original post

8 REPLIES 8
Jay54
Meteorite | Level 14

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;

Ram_SAS
Obsidian | Level 7

Thanks for your reply Sanjay.  ODS destination gives some error in SAS Studio.

 
ERROR: Insufficient authorization to access /opt/sasinside/SASConfig/Lev1/SASApp/sashtml24.htm.
ERROR: No body file. HTML output will not be created.
Jay54
Meteorite | Level 14

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;

Ram_SAS
Obsidian | Level 7
Great. Thanks for the explanation. I am a big fan of your papers and books. Congratulations on your achievements and contributions in this area!
qinghuac
Calcite | Level 5

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

qinghuac
Calcite | Level 5

sorry.  It worked as we speak.  I found the options.  Thanks much anyway.

Jay54
Meteorite | Level 14

The STYLEATTRS statement can be used to specify the list of colors, symbols and line patters to be used for the groups.

qinghuac
Calcite | Level 5
ods graphics / attrpriority=none; does the trick!
Thanks Sanjay!

BTW, I am working for a different company now. Stay in touch.

sas-innovate-2024.png

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.

 

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.

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
  • 8 replies
  • 7661 views
  • 2 likes
  • 3 in conversation