BookmarkSubscribeRSS Feed
young_spruce
Fluorite | Level 6

Hi,

 

I'm creating a map with labels and I'm running into readability issues. The map has about nineteen automatically generated colours, so labels aren't always fully contrasting with the background. I figured that a way to solve for this problem is to use a white coloured font that is outlined with a black line.  

 

Is there a way to outline fonts in SAS without having to install a new font?

 

My current map looks like this:

Example of similar mapExample of similar map

 

I would like the font to look like this:

Desired font styleDesired font style

 

 

 

 

 

 

 

 

 

 

The code I use to define my labels:

data anno_labels;
	set a1;
	xsys='2';
	ysys='2';
	hsys='3';
	when='a';
	function='label';
	position='5';
	size=2.0;
	color='black';
	text=column1;
run;

 

2 REPLIES 2
ballardw
Super User

You may want to investigate the CBOX option to set a standard color of the "box" that the text appears in to address the contrast between text and map area colors.

 

There should be catalog, SASHELP.FONTS that contains the fonts SAS Graph uses. The fonts whose names end in E, for 'empty', are outline fonts. SWISSE might be likely candidate as it is similar to Helvetica . From the documentation:

All of the SAS/GRAPH fonts are stored in the catalog SASHELP.FONTS. For many fonts, the last letter or letters of the font name indicates weight or spacing of the font:
B
bold (thicker)
E
empty (outline) versions of their counterparts
I
italic (slanted)
L
light (thin)
U
uniformly spaced versions of their counterparts; most of the SAS/GRAPH fonts that do not end in U are proportionately spaced. However, the kanji fonts are always uniform.
X
expanded (wider characters and extra space between characters).
CAUTION:
Empty and uniform versions of fonts cannot be used if you have deleted their filled or proportionally spaced counterparts.

 

The Style= option should set the font for the text of a Label function for the specific text. Use in your data set would be

 

style='Your font name goes here';

 

 

Rick_SAS
SAS Super FREQ

What procedure are you using to draw the map? The SG procedures (which includes PROC SGMAP) support the BACKFILL, OUTLINE, and BACKLIGHT options. You can experiment with those options to create effects like you want. Here is a link to the SGMAP doc.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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