Graphics Programming

Data visualization using SAS programming, including ODS Graphics and SAS/GRAPH. Charts, plots, maps, and more!
BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
davehalltwp
Quartz | Level 8

I'm doing a scatter plot with only two discrete categories on the X axis.  I would like to use two different symbols for each category.  I'm used to using a different symbol per  third grouping, such as sex, but how can I use a different symbol per category?  It seems too simple to do, ha ha.

 

Here's what I want it to look like:

 

davehalltwp_0-1722276222424.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

Example:

 

ods graphics/attrpriority=none;
proc sgplot data=sashelp.class;
    styleattrs datasymbols=(asterisk circle diamond triangle plus x);
    scatter x=age y=weight/group=age grouporder=ascending;
run;
--
Paige Miller

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

Example:

 

ods graphics/attrpriority=none;
proc sgplot data=sashelp.class;
    styleattrs datasymbols=(asterisk circle diamond triangle plus x);
    scatter x=age y=weight/group=age grouporder=ascending;
run;
--
Paige Miller
DanH_sas
SAS Super FREQ

The ATTRPRIORITY=NONE option is the key here. Just specifying that option will get you different symbols from the active style. The list of symbols in the procedure is not required.

davehalltwp
Quartz | Level 8

Thank you, Paige.  Much better now.

 

Dan, thank you as well.  It turned out that I had commented out the ODS GRAPHICS line, which didn't have the ATTRPRIORITY setting anyway.

 

As usual, I've learned from you all...

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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
  • 966 views
  • 4 likes
  • 3 in conversation