NCL Home> Application examples> Maps and map projections || Data files for some examples

Example pages containing: tips | resources | functions/procedures

NCL Graphics: Lat/lon grid lines on maps

Drawing maps with lat/lon grids

Drawing lat/lon grid lines on map can be done by setting mpGridAndLimbOn to True.

Resources to control the look of the lat/lon lines include those that start with "mpGrid":

To draw the lat/lon grid associated with a particular variable, see the "Drawing locations of data values via markers or lines" examples page.

mapgrid_1.ncl: Shows how to turn on a lat/lon grid on a map by setting mpGridAndLimbOn to True.

mapgrid_2.ncl: Shows how to draw the lat/lon grid lines with different spacings and with a dash pattern, using mpGridLineDashPattern, mpGridLatSpacingF, and mpGridLonSpacingF.

mpGridAndLimbDrawOrder is set to "PreDraw" so that the map grid lines are drawn before the map outlines and map fill.

mapgrid_3.ncl: Shows how to draw two sets of map lat/lon grids with different spacings and colors. To do this, you need to create two map plots, and then add one map as an annotation of another with gsn_add_annotation.
mapgrid_4.ncl: Shows how to mask the grid lines over land and inland water bodies, by setting mpGridMaskMode = "MaskNotOcean".
mapgrid_5.ncl: Shows how to draw lat/lon lines using using lat/lon coordinate arrays attached to a variable read off a NetCDF file. Note that only every third lat/lon line is drawn, to keep the plot from being too busy.
mapgrid_6.ncl: Shows how to add latitude labels to a stereographic map centered over the north pole. Note that the tickmark labels only show longitude locations. The latitude labels are attached using gsn_add_text.
mapgrid_7.ncl: Draws a WRF lat/lon grid using a new function called gsn_coordinates.

To see more examples of drawing lat/lon grids or meshes associated with a particular variable, see the "Drawing locations of data values via markers or lines" examples page.

mapgrid_8.ncl: Draws a lat/lon grid over an existing plot using gsn_coordinates. The grid is first drawn using markers, to show the locations of missing and non-missing data, and then it is drawn as lines.