Main Content

Create Maps Using geoshow

Create a range of different maps using geoshow.

Geographic map 1: World Land Area

Create a worldmap. Then project and display world land areas.

worldmap world
geoshow('landareas.shp','FaceColor',[0.5 1.0 0.5])

You can also project and display world land areas using a default Plate Carree projection.

geoshow('landareas.shp','FaceColor',[0.5 1.0 0.5])

Figure contains an axes. The axes contains 537 objects of type patch.

The axes show position in latitude and longitude, but are displayed on a set of ordinary axes. To display geographic data on a set of map axes instead, use axesm, usamap, or worldmap before calling geoshow.

ans = 0

Geographic map 2: North America with Custom Colored States in the U.S.

Read the USA high resolution data.

states = shaperead('usastatehi','UseGeoCoords',true);

Create a SymbolSpec to display Alaska and Hawaii as red polygons.

symbols = makesymbolspec('Polygon', ...
    {'Name','Alaska','FaceColor','red'}, ...

Create a world map of North America with Alaska and Hawaii in red, and all other states in blue.

worldmap('north america')
geoshow(states,'SymbolSpec',symbols, ...
axis off

Geographic map 3: Korea Elevation Grid

Load elevation data and a geographic cells reference object for the Korean peninsula. Import a land area boundary using shaperead.

load korea5c
S = shaperead('landareas','UseGeoCoords',true);

Create a world map. Then project and display the elevation data as a texture map.


Overlay the land area boundary as a line.


Geographic map 4: EGM96 Geoid Heights

Get geoid heights and a geographic postings reference object from the EGM96 geoid model. Then, display the heights as a surface using an Eckert projection. Ensure the surface appears below the grid lines by setting the 'CData' name-value pair to the geoid height data and the 'ZData' name-value pair to a matrix of zeros. Display the frame and grid of the map using framem and gridm. Display the parallel and meridian labels using plabel and mlabel.

[N,R] = egm96geoid;
axesm eckert4
Z = zeros(R.RasterSize);
axis off

Create a colorbar and add a text description. Then, mask out all the land.

cb = colorbar('southoutside');
cb.Label.String = 'EGM96 Geoid Heights in Meters';

Geographic map 5: Moon Albedo Image

Load moon albedo data and a geographic cells reference object. Project and display the data using the default Plate Carree projection.

load moonalb20c

Figure contains an axes. The axes contains an object of type surface.

Project and display the moon albedo data using an orthographic projection. To do this, create a map axes object and specify the projection as orthographic. Display the data in the map axes as a texture map using geoshow. Then, change the colormap to grayscale and remove the axis lines.

axesm ortho 
colormap gray
axis off

See Also

| | | | | |