Main Content


Toggle and control display of graticule lines


gridm(MapAxesPropertyName, PropertyValue,...)
h = gridm(...)


gridm toggles the display of a latitude-longitude graticule. The choice of meridians and parallels, as well as their graphics properties, depends on the property settings of the map axes.

gridm('on') creates the graticule, if it does not yet exist, and makes it visible.

gridm('off') makes the graticule invisible.

gridm('reset') redraws the graticule using the current map axes properties.

gridm(linespec) uses any valid linespec to control the graphics properties of the lines in the graticule.

gridm(MapAxesPropertyName, PropertyValue,...) sets the appropriate graticule properties to the desired values. For a description of these property names and values, see Properties That Control the Grid section of the axesm property reference page.

h = gridm(...) returns the handles of the graticule lines. If both parallels and meridians exist, then h is a two-element vector: h(1) is the handle to the line comprising the parallels, and h(2) is the handle to the line comprising the meridians.


  • You can also create or alter map grid properties using the axesm or setm functions.

  • By default the Clipping property is set to 'off'. Override this setting with the following code:

    hgrat = gridm('on'); 

See Also


Introduced before R2006a