POSITION Variable
Controls placement and alignment of a text string specified by the LABEL function.
| Type: | character |
|---|---|
| Length: | 1 |
| Default: | 5 |
Table of Contents
Syntax
Variable Values
text-position
specifies the placement of the text string in relation to the position that is defined by the X and Y variables. Text-position can be one of the characters 1 through 9, A through F, <, +, or >. These characters represent the positions that are described in the following table.
|
Vertical Position of Text Relative To Specified Location |
Horizontal Alignment | ||
|---|---|---|---|
|
Right |
Center |
Left | |
|
One cell above location |
1 |
2 |
3 |
|
Centered on location |
< |
+ |
> |
|
Text baseline half cell below location |
4 |
5 |
6 |
|
One cell below location |
7 |
8 |
9 |
|
Half cell above location |
A |
B |
C |
|
Half cell below location |
D |
E |
F |
These positions are illustrated in Effect of POSITION Values on Text Strings.
'0'
specifies a pause in the string in order to change an attribute, such as the color of the text.
Details
Positioning Text Strings
Effect of POSITION Values on Text Strings shows the effect of the POSITION= variable values on text string, "Text." In each image, The red dot represents the location specified for the text string. The gray box surrounding the text string indicates the bounding box for the text.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The <, +, and > positions are recommended for labels that are numbers. The + position is also recommended for annotating -based . The <, +, and > positions are especially useful when you are labeling a horizontal bar chart. You can use <, +, or > if the numbers in your font are significantly smaller than the text and you are having trouble centering labels. If the numbers in your font are the same or nearly the same height as the text, you can use positions 4, 5, and 6 to center the labels.
Stacking Text Strings
To stack text strings, specify a different position value of each string. Combining POSITION Values to Stack Text shows two ways to stack text. The text bounding boxes are shaded with different colors so that you can see how they overlap when text strings are stacked.
Combining POSITION Values to Stack Text

Changing Attributes in the Middle of a Text String
0 is a special value to use when you want to pause and then continue a text string. With this value, you can change colors, , and so on, in the middle of a line, while retaining the exact position of the text at the pause. When POSITION='0', the combined text string is left-justified beginning at the point that is defined by the X and Y variables. However, you must define missing values for X for the continuation string. The following Annotate data set changes the font in the middle of the string. The result is shown in Using POSITION='0' to Change the Attributes of a Text String.
data anno;
length style $ 8 text $ 12;
xsys="3"; ysys="3"; hsys="3"; x=5; y=50;
style="swissb"; size=10; text="This is the";
position="0"; output;
x=.; style="swissbi"; text=" ITALIC font";
output;
run;

















