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

Hi SAS users,

I'm looking to stylize my gmap output but am struggling with the proper code.  Here's what I have right now.

data anno;

retain xsys ysys '2' hsys '3' function 'label' style 'wingdings' text '6c'x  size 3 when 'a';

set have;

select;

   when (topic1 and not topic0) color = 'green';

   when (topic0 and not topic1) color = 'blue';

   otherwise                color = 'red';

end;

run;

The output is dots with different colors for each 'when' statement (i.e. topic1 and not topic0, etc).  I would like an output where I have both different colors and different symbols for each 'when'.  I  also cannot figure out the coding system for text in style 'wingdings' so that I can select what the symbol should be.

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
MikeZdeb
Rhodochrosite | Level 12

hi ... to see the contents of any font, you can use PROC GFONT

GFONT (by default) will show the HEX characters for any symbol and SHOWROMAN adds printable characters to the output

for example, try the following and you'll see that a DOT in hex is '6c'x, but you could also specify 'l' (that's a lowercase L) ...

proc gfont name='wingdings' showroman nobuild;

run;

the first screen produced by GFONT in the graphics output window is attached and based on that chart, you could try something like ...

data anno;

retain xsys ysys '2' hsys '3' function 'label' style 'wingdings' size 3 when 'a';

set have;

select;

* green dot;

   when (topic1 and ^topic0) do; color = 'green'; text = '6c'x; end;

* blue square;

   when (topic0 and ^topic1) do; color = 'blue'; text = '6e'x; end;

* red diamond;

   otherwise                 do; color = 'red'; text = '75'x; end;

end;

run;





wingdings.png

View solution in original post

2 REPLIES 2
ballardw
Super User

The way to apply the different symbols would be

When (topic1 and not topic0) do; color='green'; text='a';end;  /* the text here being the letter corresponding to the desired symbol*/

The below code will generate at table of ascii codes and letters (second column) with the third column in the desired font.

data fontvals;
   do i=0 to 255;
      y=byte(i);
      j=i;
      output;
   end;
run;

/* put the name of a true type font here, easiest is to */
/* open the fonts folder in control panel. DO not put   */
/* extension or (true type), just the name part         */
/* probably need to match capitalization as well        */
%let font= Wingdings;

ods listing close;
proc print data=fontvals noobs label;
   title "Font name &Font";
   var i;
   var y/ style=[Font_face="Times New Roman" font_size=5];
   var y/ style=[font_face="&font" font_size=40 bordercolor=red];
   label i='ASCII code'
         y="";
run;
ods listing;


MikeZdeb
Rhodochrosite | Level 12

hi ... to see the contents of any font, you can use PROC GFONT

GFONT (by default) will show the HEX characters for any symbol and SHOWROMAN adds printable characters to the output

for example, try the following and you'll see that a DOT in hex is '6c'x, but you could also specify 'l' (that's a lowercase L) ...

proc gfont name='wingdings' showroman nobuild;

run;

the first screen produced by GFONT in the graphics output window is attached and based on that chart, you could try something like ...

data anno;

retain xsys ysys '2' hsys '3' function 'label' style 'wingdings' size 3 when 'a';

set have;

select;

* green dot;

   when (topic1 and ^topic0) do; color = 'green'; text = '6c'x; end;

* blue square;

   when (topic0 and ^topic1) do; color = 'blue'; text = '6e'x; end;

* red diamond;

   otherwise                 do; color = 'red'; text = '75'x; end;

end;

run;





wingdings.png

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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