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

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! 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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.

View solution in original post

1 REPLY 1
ballardw
Super User

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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1 reply
  • 346 views
  • 3 likes
  • 2 in conversation