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. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.


Project 3-D contour plot of map data


The contour3m function is the same as the contourm function except that the lines for each contour level are drawn in their own horizontal plane, at the z-coordinate equal to the value of that level.


collapse all

This example shows how to contour the EGM96 geoid heights in an ordinary axes as a 3-D surface with 50 levels and set the contour line color to black.

Load the geoid.

load geoid

Add the geoid as a surface.

hold on

Add a title.

title('EGM96 Global Geoid Heights with 50 Contour Levels');

View in 3-D.


This example shows how to contour in a map axes the topography and bathymetry of South Asia and the northern Indian Ocean with a contour interval of 500 meters.

Load topo.

load topo
latlim = [ 0  50];
lonlim = [35 115];
[Z, refvec] = maptrims(topo, topolegend, latlim, lonlim);
axesm('lambertstd','MapLatLimit', latlim, 'MapLonLimit', lonlim)
tightmap; axis off

Add the geoid as a surface and set the colormap.


Add a title.

title({'South Asia Topography and Bathymetry', ...
   'with 500 m Contours'});

View in 3-D

set(gca,'DataAspectRatio',[1 1 40000])


  • If you use contour3m with the globe map display, the contour3m function warns. Be careful to scale the input data relative to the radius of your reference sphere.

Introduced before R2006a

Was this topic helpful?