Main Content

The Map Grid

The map grid is the set of displayed meridians and parallels, also known as a graticule. Display the grid by setting the axesm-based map property Grid to 'on'. You can do this when you create axesm-based maps with axesm, with setm, or with the direct command gridm on.

Control Grid Spacing

To control display of meridians and parallels, set a scalar meridian spacing or a vector of desired meridians in the MLineLocation property. The property PLineLocation serves a corresponding purpose for parallels. The default values place grid lines every 30° for meridians and every 15° for parallels.

Default grid on a Miller projection

Layer Grids

By default, the grid is placed as the top layer of any display. You can alter this by changing the GAltitude property, so that other map objects can be placed "above" the grid. The new grid is drawn at its new altitude. The units used for GAltitude are specified with the daspectm function.

To reposition the grid back to the top of the display, use the command gridm reset. You can also control the appearance of grid lines with the GLineStyle and GLineWidth properties, which are ':' and 0.5, respectively, by default.

Limit Grid Lines

The Miller projection is an example in which all the meridians can extend to the poles without appearing to be cluttered. In other projections, such as the orthographic (below), the map grid can obscure the surface where they converge. Two axesm-based map properties, MLineLimit and MLineException, enable you to control such clutter:

  • Use the MLineLimit property to specify a pair of latitudes at which to terminate the meridians. For example, setting MLineLimit to [-75 75] completely clears the region above and below this latitude range of meridian lines.

  • If you want some lines to reach the poles but not others, you can specify them with the MLineException property. For example, if MLineException is set to [-90 0 90 180], then the meridians corresponding to the four cardinal longitudes will continue past the limit on to the pole.

The use of these properties is illustrated in the figure below. Note that there are two corresponding axesm-based map properties, PLineLimit and PLineException, for controlling the extent of displayed parallels.

Effects of the MLineLimit and MLineException properties on three maps. The first map shows that the default grid extends all meridians to the poles. The second map shows that the MLineLimit property truncates meridians at the specified latitudes. The third map shows that the MLineException property enables the specified meridians to extend to the poles, regardless of the value of MLineLimit.

Label Grids

You can label displayed parallels and meridians. MeridianLabel and ParallelLabel are on-off properties for displaying labels on the meridians and parallels, respectively. They are both 'off' by default. Initially, the label locations coincide with the default displayed grid lines, but you can alter this by using the PlabelLocation and MlabelLocation properties. These grid lines are labeled across the north edge of the map for meridians and along the west edge of the map for parallels. However, the property MlabelParallel allows you to specify 'north', 'south', 'equator', or a specific latitude at which to display the meridian labels, and PlabelMeridian allows the choice of 'west', 'east', 'prime', or a specific longitude for the parallel labels. By default, parallel labels are displayed in the range of 0° to 90° north and south of the equator while meridian labels are displayed in the range of 0° to 180° east and west of the prime meridian. You can use the mlabelzero22pi function to redisplay the meridian labels in the range of 0° to 360° east of the prime meridian.

Properties affecting grid labeling are listed below.

Property

Effect

MeridianLabel

Toggle display of meridian labels

ParallelLabel

Toggle display of parallel labels

MlabelLocation

Alternate interval for labeling meridians

PlabelLocation

Alternate interval for labeling parallels

MlabelParallel

Keyword or latitude for placing meridian labels

PlabelMeridian

Keyword or longitude for placing parallel labels

mlabelzero22pi(function)

Relabel meridians with positive angle from 0° to 360°

For complete descriptions of all axesm-based map properties, refer to the axesm-Based Map Properties reference page.