| Mapping Toolbox | ![]() |
Syntax
contourfm contourfm(lat,lon,map) contourfm(lat,lon,map,LineSpec) contourfm(lat,lon,map,PropertyName,PropertyValue,...) contourfm(lat,lon,map,n,...) contourfm(lat,lon,map,v,...) contourfm(map,maplegend) contourfm(map,maplegend,...) c = contourfm(...) [c,h] = contourfm(...)
Description
contourfm(lat,lon,map) produces a contour plot of map data projected onto the current map axes. The input latitude and longitude vectors can be the size of map (as in a general matrix map), or can specify the corresponding row and column dimensions for the map.
contourfm(map,maplegend) produces a contour plot of map data in a regular matrix map.
contourfm(lat,lon,map,LineSpec) uses any valid LineSpec string to draw the contour lines.
contourfm(lat,lon,map,PropertyName,PropertyValue,...) uses the line properties specified to draw the contours.
contourfm(lat,lon,map,n,...) draws n contour levels, where n is a scalar.
contourfm(lat,lon,map,v,...) draws contours at the levels specified by the input vector v.
contourfm(map,maplegend,...) takes any of the optional arguments described above.
c = contourfm(...) returns a standard contour matrix, with the first row representing longitude data and the second row represents latitude data.
[c,h] = contourfm(...) returns the contour matrix and the handles to the contour lines drawn.
contourfm, without any inputs, will activate a GUI to project contour lines onto the current map axes.
Examples
Plot the Earth's geoid with filled contours. The data is in meters.
load geoid figure axesm eckert4 framem;gridm plotm(coast,'k') caxis([-120 100]);colormap(jet(11));colorbar contourfm(geoid,geoidlegend,-120:20:100);
You can reproduce the filled contour display by using a surface instead of the patches created by contourfm.
figure axesm eckert4 framem;gridm plotm(coast,'k') meshm(geoid,geoidlegend,size(geoid),'Facecolor','interp') contourcmap(20,'jet');colorbar
Surfaces also allow use of lighting to bring out the smaller variations in the data.
clmo surface meshm(geoid,geoidlegend,size(geoid),geoid,'Facecolor','interp') light;lighting phong; material(0.6*[ 1 1 1]) set(gca,'dataaspectratio',[ 1 1 200]) gridm reset zdatam(handlem('line'),max(geoid(:)))
Limitations
contourfm may not fill properly with azimuthal projections.
Remarks
The patches are drawn at a range of z-levels < 0 to ensure proper display. Contours are displayed with no edge colors. To combine contour fill with contour lines, use both contourfm and contourm.
In most circumstances, contour plots made with surfaces are preferable to the filled patches created by contourfm. Surfaces render more quickly and take less time to project and re-project. The use of surfaces also allows surface lighting to create shaded 3-D maps.
See Also
contourm |
Project a contour plot of data onto the current map axes |
contour3m |
Project a 3-D contour plot of data onto the current map axes |
clabelm |
Add contour labels to a map contour plot |
| contourcmap | country2mtx | ![]() |