Main Content


Project and add geolocated data grid to axesm-based map


h = surfacem(...)


surfacem(lat,lon,Z) constructs a surface to represent the data grid Z in the current axesm-based map. The surface lies flat in the horizontal plane with its CData property set to Z. The vectors or 2-D arrays lat and lon define the latitude-longitude graticule mesh on which Z is displayed. For a complete description of the various forms that lat and lon can take, see surfm.

surfacem(latlim,lonlim,Z) defines the graticule using the latitude and longitude limits latlim and lonlim. These limits should match the geographic extent of the data grid Z. The two-element vector latlim has the form:

[southern_limit northern_limit]

Likewise, lonlim has the form:

[western_limit eastern_limit]

A latitude-longitude graticule of size 50-by-100 is constructed. The surface FaceColor property is 'texturemap', except when Z is precisely 50-by-100, in which case it is 'flat'.

surfacem(lat,lon,Z,alt) sets the ZData property of the surface to 'alt', resulting in a 3-D surface. Lat and lon must result in a graticule mesh that matches alt in size. CData is set to Z. Facecolor is 'texturemap', unless Z matches alt in size, in which case it is 'flat'.

surfacem(...,prop1,val1,prop2,val2,...) applies additional MATLAB® graphics properties to the surface via property/value pairs. You can specify any property accepted by the surface function, except XData, YData, and ZData.

h = surfacem(...) returns a handle to the surface object.


Unlike meshm and surfm, surfacem always adds a surface to the current axes, regardless of hold state.


Load elevation raster data and a geographic cells reference object. Then, display the data as a surface.

load topo60c
[topo60c,topo60cR] = geocrop(topo60c,topo60cR,[-90 90],[-180,180]);
[lat,lon] = geographicGrid(topo60cR);
worldmap world

Topographic world map

Version History

Introduced before R2006a

See Also

| | |