Sample 47789: Use the SAS/GRAPH® Annotate facility to create a symbol table containing all the special symbols that are available with a particular font
To add a special symbol to SAS/GRAPH output, you first need to determine which hardware font offers the special symbol that you want. The next step is to determine which hexadecimal value in that hardware font will produce the desired special symbol.
The sample code on the Full Code tab uses the SAS/GRAPH Annotate facility to produce a table showing all of the special symbols that are available with the Symbol hardware font. The hexadecimal value for each symbol is displayed above each symbol in the table the code creates.
In the table for the Symbol hardware font, we can see that a value of "a3"x will display the "less than or equal to" symbol on a graph.
Note that the Output tab for this sample shows three different tables: one for the Symbol font, one for the Wingdings font, and one for the Arial font.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
The sample code below uses the SAS/GRAPH Annotate facility to produce a table showing all of the special symbols that are available with the Symbol hardware font. The hexadecimal value for each symbol is displayed above each symbol in the table the code creates.
filename grafout 'symbol_font.png';
goptions reset = all
device = png
gsfname = grafout
gsfmode = replace
ymax = 8 in;
/*************************************************/
/* Generate the hex values. The "A" values do */
/* not include 0 and 1 because these values are */
/* reserved for commands in most hardware fonts. */
/*************************************************/
data one;
do a='2','3','4','5','6','7','8','9','a','b','c','d','e','f';
do b='0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f';
char=input(a||b,$hex3.);
output;
put char=;
end;
end;
run;
/********************************************/
/* Create annotation to show the symbol and */
/* the hex value underneath */
/********************************************/
data anno;
length text $2 style $25;
retain xsys '3'
ysys '3'
tempy 94
x 0
size 1.2
count 0
y 0
position '6';
set one;
count = count + 1;
x = x + 4;
y = tempy;
text = compress(a||b);
style = "'Arial'";
output;
y = tempy - 3;
function = 'label';
/* This code creates output using the */
/* Symbol hardware font. Change the */
/* value for STYLE= below to use a */
/* font other than Symbol. */
style = "'Symbol'";
text = char;
output;
if int(count/16) = (count/16) then do;
x = 0;
tempy = tempy - 6;
end;
run;
/***************************************************/
/* List all the values. The character is shown */
/* above its hex value. For example, the "less */
/* than or equal to" symbol is the hex value A3. */
/* To use this symbol in a TITLE statement with */
/* SAS/GRAPH, specify: */
/* title1 font="Symbol" "A3"x; */
/***************************************************/
title1 h=12pt j=l 'Symbol table for the Symbol font';
proc gslide anno=anno;
run;
quit;
filename grafout clear;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This sample illustrates how to use the SAS/GRAPH® Annotate facility to create a symbol table containing all the special symbols that are available with a particular font.
Date Modified: | 2012-09-05 15:01:23 |
Date Created: | 2012-09-04 15:19:05 |
Operating System and Release Information
SAS System | SAS/GRAPH | z/OS | 9.1 TS1M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.1 TS1M0 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.1 TS1M0 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.1 TS1M0 | |
Microsoft Windows 2000 Advanced Server | 9.1 TS1M0 | |
Microsoft Windows 2000 Datacenter Server | 9.1 TS1M0 | |
Microsoft Windows 2000 Server | 9.1 TS1M0 | |
Microsoft Windows 2000 Professional | 9.1 TS1M0 | |
Microsoft Windows NT Workstation | 9.1 TS1M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M0 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M0 | |
Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M0 | |
Microsoft Windows XP Professional | 9.1 TS1M0 | |
64-bit Enabled AIX | 9.1 TS1M0 | |
64-bit Enabled HP-UX | 9.1 TS1M0 | |
64-bit Enabled Solaris | 9.1 TS1M0 | |
HP-UX IPF | 9.1 TS1M0 | |
Linux | 9.1 TS1M0 | |
OpenVMS Alpha | 9.1 TS1M0 | |
Tru64 UNIX | 9.1 TS1M0 | |