Work with grid label tags

Labels for graticules, measured grids, and MGRS grids are written and formatted using tags. Tags can be used individually, or combined to create complex labels. There are some tags that work for all grid types, and some tags that are specific to a certain type.

For a broader review of tags, see Dynamic text tags.

Format labels with tags

To format a label using tags, follow these steps:

  1. In the Contents pane, expand the map frame, right-click a grid, and choose Properties.

    The Format Map Grid pane appears.

  2. In the Format Map Grid pane, click the Components tab Components, and select a component to format. The following components use formatting tags:
    • Labels
    • Corner Labels
    • Interior Labels
  3. In the Format text box, modify the labels using tags.

Tags for graticules

The following tags can be used for graticule labels:

TagDescriptionExample syntaxExample output

units

Specify the degree format for the coordinate. For a complete list of accepted inputs, see Dynamic text tags.

<dyn type="grid" units="dd"/>

11.1805°N

showSymbol

Show the degree, minute, and second symbols.

The default is True.

<dyn type="grid" units="dms" showDirections = "False" showSymbol = "False" />

0 1 21N

decimalPlaces

Show the number of decimal places.

<dyn type="grid" units="dms" decimalPlaces="2"/>

5°4'59.32"W

padDecimal or zeroPad

Show decimalPlaces with the value of 0.

The default is False.

<dyn type = "grid" units = "dd" decimalPlaces = "3" zeroPad = "True" showDirections = "None"/>

50.100°

showZeroMinutes

Show the minute value if it is equal to zero.

The default is False.

<dyn type="grid" units="dms" showZeroMinutes = "True" showDirections = "True"/>

10°0'N

showZeroSeconds

Show the second value if it is equal to zero.

The default is False.

<dyn type="grid" units="dms" showZeroMinutes="True" showZeroSeconds="True" showDirections = "True"/>

10°0'0"N

padDegrees

Show two digits in degree values for latitudes and three digits in degree values for longitudes. Pad the value with 0 if the value isn't long enough.

The default is False.

<dyn type = "grid" units = "dms" padDegrees="True"/>

001°3'2"E

padMinutes

Show two digits for all minute values.

The default is False.

<dyn type = "grid" units = "dms" padDegrees="True" padMinutes="True"/>

001°03'2"E

padSeconds

Show two digits for all second values.

The default is False.

<dyn type = "grid" units = "dms" padDegrees="True" padMinutes="True" padSeconds="True"/>

001°03'02"E

showDirections

Show the cardinal point associated with the coordinate.

True shows the cardinal point after the coordinate, False does not show the cardinal point but shows a negative sign if applicable, and None does not show the cardinal point or a negative sign.

The default is True.

<dyn type="grid" units="dms" showDirections = "False" />

-50°2'6"

directionSeparator

Separate coordinate value and direction. This tag is ignored if showDirections="False" or showDirections="None".

<dyn type="grid" units="dms" showDirections = "True" directionSeparator = " – "/>

50° – W

showPlusSign

Show a plus sign or negative sign in front of the coordinates. Requires that showDirections is set to None or False.

The default is False.

<dyn type="grid" units="dms" showDirections = "False" showPlusSign = "True" />

+10°

cardinalDir

Display the cardinal point as a separate label element that can be formatted independent of the coordinate.

<dyn type="grid" cardinalDir = "True"/>

N

vAlign

Align the label component to the topmost or bottommost extent of the label as a whole.

<dyn type="grid" units="dd.deg.int"/><FNT size="4"><dyn type="grid" vAlign="top" units="dd.deg.dec" decimalPlaces="2"/></FNT>

11²²

Graticule label examples

The following are examples of how label tags can be combined to create complex labels.

Example 1: Decimal degrees with three decimal places and the cardinal point.

Label example in decimal degrees with three decimal places and the cardinal point

<dyn type="grid" units="dd" decimalPlaces="3" zeroPad="True" showDirections="True" directionSeparator=" "/>.

Example 2: Decimal degrees with three decimal places, a negative sign, and no degree symbol.

Label example in decimal degrees with three decimal places, a negative sign, and no degree symbol

<dyn type="grid" units="dd" decimalPlaces="3" zeroPad="True" showDirections="False" showSymbol="False"/>.

Example 3: Degrees, minutes, and seconds with minutes and seconds italicized in blue. Minutes and seconds are set at a smaller font size and aligned to the top of the degree value.

Label example with degrees, minutes, and seconds with minutes and seconds italicized in blue. Minutes and seconds are set at a smaller font size and aligned to the top of the degree value.

<dyn type ="grid" units="dms.deg"/>°<CLR blue="200"><FNT name="Arial" size="5"><ITA><dyn type="grid" vAlign="top" units="dms.min" showZeroMinutes="True"/>'<dyn type="grid" units="dms.sec" showZeroSeconds="true" zeroPad="True" decimalPlaces="0" vAlign=top"/>"</ITA></FNT></CLR>

Example 4: Decimal degree minutes with two decimal places. The minutes value is set at a smaller font size and aligned to the bottom of the degree value. The degree, degree symbol, and minutes are all separate tags.

Label example with decimal degree minutes with two decimal places. Minutes are set at a smaller font size and aligned to the bottom of the degree value.

<dyn type="grid" units="ddm.deg.int"/><dyn type="grid" units="ddm.deg.sym"/><FNT size="4"><dyn type="grid" vAlign="bottom" units="ddm.min" showZeroMinutes="true" zeroPad="true" decimalPlaces="2"/></FNT>.

Measured and MGRS grids

The following tags can be used with measured or MGRS grids:

TagsDescriptionExample SyntaxExample Output

units

Specify and show the unit.

<dyn type="grid" units="meters"/>

6000000N m

separator

Display the thousands separator.

The default is False.

<dyn type="grid" showDirections="False" separator="True"/>

6,000,000

decimalPlaces

Shows the number of decimal places.

<dyn type="grid" decimalPlaces="2" showDirections="False" separator="True" />

1,696,631.25

padDecimal or zeroPad

Show decimalPlaces with the value of 0.

The default is False.

<dyn type="grid" padDecimal="True" decimalPlaces = "2"/>

7,014,000.00W

placeValue

Specify a place value of the grid label. For example, placeValue = "100" refers to the hundred's place.

<dyn type="grid" showDirections="none" placeValue = "10000" digits = "1"/>

5

(Full coordinate is 1450000)

digits

Designate how many digits to the left of the place value to display. This includes the place value.

This tag is ignored when using placeValue.right.

<dyn type="grid" showDirections="False" placeValue = "1000" digits = "2" />

97

(Full coordinate is 1697000)

.left or .right

Append to the place value to designate the digits displayed in the label.

.left includes the place value.

.right does not include the place value.

<dyn type="grid" showDirections="False" placeValue = "10000.right"/>

7445

(Full coordinate is 1697445)

showDirections

Show the cardinal point associated with the coordinate.

True shows the cardinal point after the coordinate, False does not show the cardinal point but shows a negative sign if applicable, and None does not show the cardinal point or a negative sign.

The default is True.

<dyn type="grid" units="meters" showDirections = "False"/>

-14000000 m

directionSeparator

Separate coordinate value and direction. This tag is ignored if showDirections="False" or showDirections="None".

<dyn type="grid" showDirections = "True" directionSeparator = " – "/>

1450000 – N

showPlusSign

Show a plus sign in front of coordinates if applicable. Requires that showDirections is set to None or False.

The default is False.

<dyn type="grid" showDirections = "False" showPlusSign = "True" />

+7014000

cardinalDir

Display the cardinal point as a separate label element that can be formatted independent of the coordinate.

<dyn type="grid" cardinalDir = "True"/>

N

vAlign

Align the label component to the topmost or bottommost extent of the label as a whole.

<dyn type="grid" showDirections="none" placeValue="10000.left"/><FNT size="4"><dyn type="grid" placeValue="10000.right" vAlign="top"/></FNT>

825¹²²²

Measured and MGRS label examples

The following are examples of how label tags can be combined to create complex labels.

Example 1: Only the million's, hundred thousand's, and ten thousand's values of the coordinate. The million's digit is set at a smaller font size and aligned to the top of the other values. The hundred thousand's and ten thousand's digits are in bold.

Label example with only the million's, hundred thousand's, and ten thousand's values displayed. The million's digit is a smaller font size and aligned to the top of the other values. The hundred thousand's and ten thousand's digits are bolded.

<dyn type="grid" showDirections="none" placeValue="1000000" digits="1"/><FNT size="10"><BOL><dyn type="grid" placeValue="10000" digits="2" vAlign="top"/><BOL></FNT>

Example 2: Coordinate with first digits in red, and the last digits set at a smaller font size and aligned to the top of the other values.

Label example with three digits in red, and the last three digits set at a smaller font size and aligned to the top of the other values.

<FNT name='Arial' size='8'><BOL><CLR red='168' green='0' blue='0' alpha='255'><dyn type="grid" showDirections="False" separator="False" placeValue="10000" digits="3"/></CLR></BOL></FNT><FNT name='Arial' size='5'><CLR red='178' green='178' blue='178' alpha='255'><dyn type="grid" vAlign="top" placeValue="10000.right" decimalPlaces="0" /></CLR></FNT>

Example 3: Coordinate with some digits set at a smaller font size and aligned to the top of the other values. The unit and cardinal point displayed.

Label example with some digits smaller and aligned to the top of the other values. The unit and cardinal point displayed.

<dyn type="grid" showDirections="none" placeValue="1000000" digits="1"/><FNT size="12"><dyn type="grid" placeValue="10000" digits="2" vAlign="top"/></FNT><dyn type="grid" placeValue="10000.right" vAlign="top"/>m.<FNT size="10"><dyn type="grid" cardinalDir="True" vAlign="top"/></FNT>

Related topics