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:
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;
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;
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.
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...
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.