HOW TO
A feature can be labeled to contain descriptive text on the feature, by displaying the values in a certain field from the attribute table. In some cases, it is desirable to stack labels from a single field to reduce its horizontal length and to provide better a view, similar to the concept of word wrap. This is possible in ArcMap using the Label Manager in the Labeling toolbar with the Python expression.
The following steps describe how to stack labels from a single field:
def FindLabel ([Field_Name]): x = [Field_Name] x1 = x.split(" ") if len(x1)>1: return x1[0] + '\n' + x1[1] else: return x1[0]
Note: The array parameter x1[n] can be added and modified according to the number of words present in the value. For example: return x1[0] + '\n' + x1[1] + '\n' + x1[2]
Get help from ArcGIS experts
Download the Esri Support App