This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Create geographic axes


gx = geoaxes(___)



geoaxes creates a geographic axes in the current figure using default property values, and makes it the current axes.

A geographic axes displays data in geographic coordinates (latitude/longitude) on a map. The map is live, that is, you can pan to view other geographic locations and zoom in and out on the map to view regions in more detail.

geoaxes(Name,Value) specifies values for properties of the GeographicAxes object using one or more name-value pair arguments.

geoaxes(parent,___) creates the geographic axes in the figure, panel, or tab specified by parent, instead of in the current figure.

gx = geoaxes(___) returns the GeographicAxes object. Use gx to modify properties of the axes after you create it.

geoaxes(gx) makes the GeographicAxes object gx the current axes.


collapse all

Create a geographic axes.

gx = geoaxes;

Plot your data, using the geoplot function. You can specify the geographic axes you created to geoplot. The example also specifies the type and color of the line in the plot and changes the basemap to a non-default basemap.

latSeattle = 47.62;
lonSeattle = -122.33;
latAnchorage = 61.20;
lonAnchorage = -149.9;
geoplot(gx,[latSeattle latAnchorage],[lonSeattle lonAnchorage],'g-*')

Input Arguments

collapse all

Parent, specified as a Figure, Panel, or Tab object.

Geographic axes to be made current axes, specified as a GeographicAxes object.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: gx = geoaxes('Basemap','colorterrain')

The properties listed here are only a subset. For a complete list, see GeographicAxes Properties.

Map on which to plot data, specified as one of the string scalars or character vectors in the following table, or 'none'.

MathWorks® offers six basemaps for use with geographic axes and charts. The basemaps provide a variety of display options, from two-tone, land-ocean raster maps to color terrain maps. By default, geographic axes or charts use the 'darkwater' basemap, which is installed with the product. If you choose one of the other basemaps, the geographic axes or chart accesses the map over the Internet.

If you do not have consistent access to the Internet, you can download the basemaps hosted by MathWorks onto your local system. For more information about downloading basemaps, see Access Basemaps in MATLAB.

If you specify 'none', the geographic axes or chart plots your data with latitude-longitude grid, ticks, and labels, but does not include a map.


'darkwater' (default)

Land areas: light-to-moderate gray

Ocean and water areas: darker gray

Hosted by MathWorks.


Shaded relief map blended with a land cover palette. Humid lowlands are green and arid lowlands brown.

Hosted by MathWorks.


Land areas: light-to-moderate gray land

Ocean and water areas: white

Hosted by MathWorks.


Worldwide terrain depicted monochromatically in shades of gray, combining shaded relief that emphasizes both high mountains and the micro terrain found in lowlands.

Hosted by MathWorks.


Land areas: light green

Ocean and water areas: light blue

Hosted by MathWorks.


Satellite-derived land cover data and shaded relief presented with a light, natural palette suitable for making thematic and reference maps (includes ocean-bottom relief).

Hosted by MathWorks.

Example: gx = geoaxes(__,'Basemap','bluegreen')

Example: gx.Basemap = 'bluegreen'

Data Types: char | string

Size and location, excluding margin for labels, specified as a four-element vector of the form [left bottom width height]. For more information, see Control Axes Layout.

Position units, specified as one of these values.

'normalized' (default)Normalized with respect to the container, which is typically the figure or a panel. The lower left corner of the container maps to (0,0), and the upper right corner maps to (1,1).

Based on the default uicontrol font of the graphics root object:

  • Character width = width of letter x.

  • Character height = distance between the baselines of two lines of text.

'points'Typography points. One point equals 1/72 inch.


Starting in R2015b, distances in pixels are independent of your system resolution on Windows® and Macintosh systems:

  • On Windows systems, a pixel is 1/96th of an inch.

  • On Macintosh systems, a pixel is 1/72nd of an inch.

On Linux® systems, the size of a pixel is determined by your system resolution.

When specifying the units as a name-value pair during object creation, you must set the Units property before specifying the properties that you want to use these units, such as OuterPosition.

Output Arguments

collapse all

Geographic axes, returned as a GeographicAxes object.


  • If you have Mapping Toolbox™, you can specify basemaps of your own choosing by using the addCustomBasemap function.

  • Some graphics functions reset axes properties when plotting. To plot additional data in a geographic axes, use the hold on command before calls to plotting functions.

  • You cannot plot data that requires Cartesian axes in a geographic chart.

Introduced in R2018b