Main Content

geoaxes

Create geographic axes

Description

example

geoaxescreates 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 islive, 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 theGeographicAxesobject using one or more name-value pair arguments.

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

gx= geoaxes (___)returns theGeographicAxesobject. Usegxto modify properties of the axes after you create it.

geoaxes(gx)makes theGeographicAxesobjectgxthe current axes.

Examples

collapse all

Create a set of geographic axes.

gx = geoaxes;

Plot data using thegeoplotfunction. To modify the geographic axes you created, specifygxas an input argument. Customize the appearance of the line using the line specification'g-*'. Change the basemap using thegeobasemapfunction.

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

Input Arguments

collapse all

Parent container, specified as aFigure,Panel,Tab,TiledChartLayout, orGridLayoutobject.

Geographic axes to be made current axes, specified as aGeographicAxesobject.

Name-Value Arguments

Specify optional comma-separated pairs ofName,Valuearguments.Nameis the argument name andValueis the corresponding value.Namemust appear inside quotes. You can specify several name and value pair arguments in any order asName1,Value1,...,NameN,ValueN.

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

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

Map on which to plot data, specified as one of the values listed in the table. Six of the basemaps are tiled data sets created usingNatural Earth. Five of the basemaps are high-zoom-level maps hosted by Esri®.

'streets-light' basemap

'streets-light'(default)

地图设计提供地理环境而highlighting user data on a light background.

Hosted by Esri.

'streets-dark' basemap

'streets-dark'

地图设计提供地理环境而highlighting user data on a dark background.

Hosted by Esri.

'streets' basemap

'streets'

General-purpose road map that emphasizes accurate, legible styling of roads and transit networks.

Hosted by Esri.

'satellite' basemap

'satellite'

Full global basemap composed of high-resolution satellite imagery.

Hosted by Esri.

'topographic' basemap

'topographic'

General-purpose map with styling to depict topographic features.

Hosted by Esri.

'landcover' basemap

'landcover'

Map that combines satellite-derived land cover data, shaded relief, and ocean-bottom relief. The light, natural palette is suitable for thematic and reference maps.

Created usingNatural Earth.

'colorterrain' basemap

'colorterrain'

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

Created usingNatural Earth.

'grayterrain' basemap

'grayterrain'

Terrain map in shades of gray. Shaded relief emphasizes both high mountains and micro-terrain found in lowlands.

Created usingNatural Earth.

'bluegreen' basemap

'bluegreen'

Two-tone, land-ocean map with light green land areas and light blue water areas.

Created usingNatural Earth.

'grayland' basemap

'grayland'

Two-tone, land-ocean map with gray land areas and white water areas.

Created usingNatural Earth.

'darkwater' basemap

'darkwater'

Two-tone, land-ocean map with light gray land areas and dark gray water areas. This basemap is installed with MATLAB®.

Created usingNatural Earth.

'none'

Blank background that plots your data with a latitude-longitude grid, ticks, and labels.

All basemaps except'darkwater'需要智力ernet access. The'darkwater'basemap is included with MATLAB.

If you do not have consistent access to the Internet, you can download the basemaps created usingNatural Earthonto your local system by using the Add-On Explorer. The five high-zoom-level maps are not available for download. For more about downloading basemaps and changing the default basemap on your local system, seeAccess Basemaps for Geographic Axes and Charts.

The basemaps hosted by Esri update periodically. As a result, you might see differences in your visualizations over time.

Alignment of boundaries and region labels are a presentation of the feature provided by the data vendors and do not imply endorsement by MathWorks®.

Example:gb = geobubble(1:10,1:10,'Basemap','bluegreen')

Example:gb.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, seeControl Axes Layout.

Position units, specified as one of these values.

Units Description
'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).
'inches' Inches
'centimeters' Centimeters
'characters'

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

  • Character width = width of letterx.

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

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

Pixels.

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

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

  • OnMacintoshsystems, 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 theUnitsproperty before specifying the properties that you want to use these units, such asOuterPosition.

Output Arguments

collapse all

Geographic axes, returned as aGeographicAxesobject.

Tips

  • Specify custom basemaps using the Mapping Toolbox™ functionaddCustomBasemap(Mapping Toolbox).

  • Add a basemap picker to the axes toolbar by using the Mapping Toolbox functionaddToolbarMapButton(Mapping Toolbox).

  • Plot 3-D geographic data using the Mapping Toolbox functionsgeoglobe(Mapping Toolbox)andgeoplot3(Mapping Toolbox).

  • Some graphics functions reset axes properties when plotting. To plot additional data in a geographic axes, use thehold oncommand before calls to plotting functions.

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

  • When you plot on geographic axes, thegeoaxesfunction assumes that coordinates are referenced to the WGS84 coordinate reference system. If you plot using coordinates that are referenced to a different coordinate reference system, then the coordinates may appear misaligned.

Introduced in R2018b