Help using Base SAS procedures

proc gmap style options

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 110
Accepted Solution

proc gmap style options

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!


Accepted Solutions
Solution
‎09-13-2012 10:55 AM
Valued Guide
Posts: 765

Re: proc gmap style options

Posted in reply to sophia_SAS

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


All Replies
Super User
Posts: 11,343

Re: proc gmap style options

Posted in reply to sophia_SAS

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;


Solution
‎09-13-2012 10:55 AM
Valued Guide
Posts: 765

Re: proc gmap style options

Posted in reply to sophia_SAS

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
🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 3888 views
  • 3 likes
  • 3 in conversation