Main Content

axesm-Based Maps

When you create a map, you can use one of the Mapping Toolbox™ built-in user interfaces (UIs), or you can build the graphic with MATLAB® and Mapping Toolbox functions. Many MATLAB graphics are built using the axes function:

h = axes(...)

Mapping Toolbox functions include an extended version of the axes function, called the axesm function. Maps created with the axesm function, called axesm-based maps (previously referred to as map axes) share all properties associated with regular axes, and they include information about the current coordinate system (map projection), as well as data to define the map grid and its labeling, the map frame and its limits, scale, and other properties. For complete descriptions of all axesm-based map properties, see the axesm-Based Map Properties reference page.

The syntax of axesm is similar to that of axes:


The axesm function without arguments brings up a UI that lists all supported projections and assists in defining their parameters. You can also summon this UI with the axesmui function once you have created an axesm-based map.

The figure window created using axesm contains the same set of tools and menus as any MATLAB figure. By default, the figure window is blank, even if there is map data in your workspace. You can toggle certain properties, such as grids, frames, and axis labels, by right-clicking in the figure window to obtain a pop-up menu.

Tips to Working with axesm-Based Maps

  • You can list all the names, classes, and IDs of map projections supported by axesm-based maps with the maps function.

  • You can place many types of objects in an axesm-based map, such as lines, patches, markers, scale rulers, north arrows, grids, and text. You can use the handlem function and its associated UI to list these objects. See the handlem reference page for a list of the objects that can occupy an axesm-based map and how to query for them.

  • You can define multiple independent figures containing axesm-based maps, but only one can be active at any one time. Use axes(obj) to activate an existing axesm-based map.

  • axesm-based maps created by axesm contain projection information in a structure. For an example of what these properties are, type

    h = axesm('MapProjection','mercator')

    and then use the getm function to retrieve all the axesm-based map properties:

    p = getm(h)

See Also

| |