Main Content


Construct map axes for given region of world



worldmap region or worldmap(region) sets up an empty map axes with projection and limits suitable to the part of the world specified in region.

worldmap with no arguments presents a menu from which you can select the name of a single continent, country, island, or region.

worldmap(latlim,lonlim) allows you to define a custom geographic region in terms of its latitude and longitude limits in degrees.

worldmap(Z,R) derives the map limits from the extent of a regular data grid, Z, georeferenced by R.

h = worldmap(___) returns the handle of the map axes.


collapse all

Set up a world map and draw coarse coastlines.

load coastlines

Set up a world map with land areas, major lakes and rivers, and cities and populated places.

ax = worldmap('World');
setm(ax, 'Origin', [0 180 0])

land = shaperead('landareas.shp', 'UseGeoCoords', true);
geoshow(ax, land, 'FaceColor', [0.5 0.7 0.5])

lakes = shaperead('worldlakes.shp', 'UseGeoCoords', true);
geoshow(lakes, 'FaceColor', 'blue')

rivers = shaperead('worldrivers.shp', 'UseGeoCoords', true);
geoshow(rivers, 'Color', 'blue')

cities = shaperead('worldcities.shp', 'UseGeoCoords', true);
geoshow(cities, 'Marker', '.', 'Color', 'red')

Draw a map of Antarctica, using the worldmap function.

antarctica = shaperead('landareas.shp', 'UseGeoCoords', true,...
  'Selector',{@(name) strcmp(name,'Antarctica'), 'Name'});
patchm(antarctica.Lat, antarctica.Lon, [0.5 1 0.5])

Draw a map of Africa and India with major cities and populated areas.

land = shaperead('landareas.shp', 'UseGeoCoords', true);
geoshow(land, 'FaceColor', [0.15 0.5 0.15])
cities = shaperead('worldcities', 'UseGeoCoords', true);
geoshow(cities, 'Marker', '.', 'Color', 'red')

Display geoid heights from the EGM96 geoid model over a map of South America and the central Pacific. First, get geoid heights and a geographic postings reference object. Load coastline latitude and longitude data.

[N,R] = egm96geoid;
load coastlines

Create a world map by specifying latitude and longitude limits. Then, display the geoid heights and coastline data.

latlim = [-50 50];
lonlim = [160 -30];


Load elevation data and a geographic cells reference object for the Korean peninsula. Create a world map with appropriate latitude and longitude limits. Then, display the data as a texture map using geoshow. Apply a colormap appropriate for elevation data using demcmap.

load korea5c

Create a map of the United States of America. Display the states using a palette of random, muted colors.


load coastlines
geoshow(coastlat,coastlon, ...
    "DisplayType","polygon","FaceColor",[0.45 0.60 0.30])

states = readgeotable("usastatelo.shp");

h = height(states);
faceColors = makesymbolspec("Polygon", ...
    {'INDEX',[1 h],'FaceColor',polcmap(h)});

geoshow(states,"DisplayType","polygon", ...

Input Arguments

collapse all

Region to display, specified as a string scalar, string array, character vector, or cell array of character vectors. Permissible values include names of continents, countries, and islands as well as 'World', 'North Pole', 'South Pole', and 'Pacific'.

Example: {'Africa','India'}

Latitude limits, specified as a two-element vector of the form [southern_limit northern_limit].

Longitude limits, specified as a two-element vector of the form [western_limit eastern_limit].

Data grid, specified as an M-by-N array. Z is a regular data grid associated with a geographic reference R.

Geographic reference, specified as one of the following.

Geographic raster reference object

GeographicCellsReference or GeographicPostingsReference geographic raster reference object. The RasterSize property must be consistent with the size of the data grid, size(Z).


1-by-3 numeric vector with elements:

[cells/degree northern_latitude_limit western_longitude_limit]

3-by-2 numeric matrix that transforms raster row and column indices to or from geographic coordinates according to:

[lon lat] = [row col 1] * R

R defines a (non-rotational, non-skewed) relationship in which each column of the data grid falls along a meridian and each row falls along a parallel.

For more information about referencing vectors and matrices, see Georeferenced Raster Data.

Output Arguments

collapse all

Handle of the map axes, returned as a handle object.


  • All axes created with worldmap are initialized with a spherical Earth model having a radius of 6,371,000 meters.

  • worldmap uses tightmap to adjust the axes limits around the map. If you change the projection, or just want more white space around the map frame, use tightmap again or auto axis.

Introduced before R2006a