I defined attribution map in SGPLOT. MarkerSymbol originally used "X" for example. Now I was asked to use circled x (unicode '2297'x). But I don't know how to do it. Please help!
One way, I'm sure there are others but you specifically mention a discrete attribute map data set, is to provide a special name for the MARKERSYMBOL value in the attribute dataset, this may require changing your currently defined length of the Markersymbol variable. May have to add or increase the MARKERSIZE in the attribute set as well.
Then in the Proc use as many SYMBOLCHAR statements to link the markersymbol name used to the unicode value.
Example:
data attrmap; input value $ markersymbol $ markercolor :$25. markersize; id='myattrid'; datalines; F charf red 25 M charm blue 25 ; proc sgplot data=sashelp.class dattrmap=attrmap; scatter x=height y=weight/group=Sex attrid=myattrid; symbolchar name=charf char="2297"x; symbolchar name=charm char="2642"x; run;
The value of MARKERSYMBOL isn't that critical but it may help to chose something you can remember. CHARF in this case for me is "character for F values". Note that I used your "circled X" for Charf.
The default marker sizes for unicode displayed this way was pretty small.
You do not have to change any other markers that may be using the traditional "circlefilled" or similar markers. The name / symbolchar only for the markers that use unicode.
One way, I'm sure there are others but you specifically mention a discrete attribute map data set, is to provide a special name for the MARKERSYMBOL value in the attribute dataset, this may require changing your currently defined length of the Markersymbol variable. May have to add or increase the MARKERSIZE in the attribute set as well.
Then in the Proc use as many SYMBOLCHAR statements to link the markersymbol name used to the unicode value.
Example:
data attrmap; input value $ markersymbol $ markercolor :$25. markersize; id='myattrid'; datalines; F charf red 25 M charm blue 25 ; proc sgplot data=sashelp.class dattrmap=attrmap; scatter x=height y=weight/group=Sex attrid=myattrid; symbolchar name=charf char="2297"x; symbolchar name=charm char="2642"x; run;
The value of MARKERSYMBOL isn't that critical but it may help to chose something you can remember. CHARF in this case for me is "character for F values". Note that I used your "circled X" for Charf.
The default marker sizes for unicode displayed this way was pretty small.
You do not have to change any other markers that may be using the traditional "circlefilled" or similar markers. The name / symbolchar only for the markers that use unicode.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.