In NCL version 4.2.0.a23, some built in tickmarks have been added to the language. To get these tickmarks, you need to set pmTickMarkDisplayMode = "Always". Not all of the tick mark resources are available for maps.

NCL Graphics: Map Tickmarks


pmTickMarkDisplayMode = "Always" will turn on these tickmarks.
The built-in tickmarks contain a degree symbol.


gsnMajorLatSpacing, gsnMinorLatSpacing, gsnMajorLonSpacing, gsnMinorLonSpacing, can be used to adjust the spacing of the default tickmarks on a ce map projection.
tmXBMinorOn, tmXTMinorOn, tmYLMinorOn, tmYRMinorOn, can be used to turn off the minor tickmarks on a particular side of a map projection.

tmXBLabelFontHeightF and its relatives (XT,YL etc) adjust the font height of tickmark labels.
tmXBMajorLengthF and adjusts the tickmark length. The plot template is designed such that changing one tickmark length (e.g. XB), changes them all.
mpGridAndLimbOn turns on the grid lines. This is a function of the map and not tickmarks. Note that there are numerous other mpGrid* resources that control its spacing and appearance.

To do this change, you must explicitly define the tickmarks and their
labels using:
tmXBMode =
"Explicit"
tmXBValues =
(/.../)
tmXBLabels = (/.../)


You must first explicitly define the tickmarks and their labels as defined in example 6 above, and then use text function codes to get a degree symbol. Set tmXTLabelsOn and tmYRLabelsOn to True to get tickmark labels on the top and right axes. Note that setting pmTickMarkDisplayMode = "Always" will also have the effect of giving you map tickmark labels with degree symbols (see example 2).

To do this change, you must explicitly define the bottom tickmarks and
their labels using:
tmXBMode =
"Explicit"
tmXBValues =
(/.../)
tmXBLabels = (/.../).
Ditto for the right Y labels using:
tmYLMode = "Explicit"
tmYLValues = (/.../)
tmYLLabels = (/.../)
In this example, the "F" function code is being used to switch to the Greek font table (font table 33) in order to get the "pi" symbol.


To use, copy the "add_map_tickmarks" function to your own code, and then set the locations where you want tickmarks by setting one or more of these resources:
res@tmYLValues = ... res@tmYRValues = ... res@tmXBValues = ... res@tmXTValues = ...




If you want to do something like this for other map projections see examples 9 and 10. You will have to change the corresponding tmXBLabels, tmXTLabels, tmYLLabels, tmYRLabels resources.

The gsn_add_text function is used to attach the labels. No labels are added at lat = abs(90) or lon = abs(180). Extra spacing is added after the left labels, and before the right labels so they don't run into the map.