Main Content

surflm

3-D shaded surface with lighting on map axes

Syntax

surflm(lat,lon,Z)
surflm(latlim,lonlim,Z)
surflm(...,s)
surflm(...,s,k)
h = surflm(...)

Description

surflm(lat,lon,Z) and surflm(latlim,lonlim,Z) are the same as surfm(...) except that they highlight the surface with a light source. The default light source (45 degrees counterclockwise from the current view) and reflectance constants are the same as in surfl.

surflm(...,s) and surflm(...,s,k) use a light source vector, s, and a vector of reflectance constants, k. For more information on s and k, see the help for surfl.

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

Examples

collapse all

Display a 3-D shaded surface with lighting on a map. To do this, first load elevation raster data and a geographic cells reference object. Get the coordinates of coastlines.

load topo60c
[topo60c,topo60cR] = geocrop(topo60c,topo60cR,[-90 90],[-180 180]);
load coastlines

Create a map axes object using a Miller projection. Remove the axes background by calling axis off.

axesm miller
axis off

Create a latitude-longitude mesh from the raster using the geographicGrid function. Then, display the elevation data as a shaded surface with lighting. Apply a grayscale colormap.

[lat,lon] = geographicGrid(topo60cR);
surflm(lat,lon,topo60c)
colormap(gray)

Display the coastlines over the surface.

plotm(coastlat,coastlon,max(topo60c(:)),...
		'LineWidth',1.5,'Color','y')

Tips

surflm is like surfm, except that it shades the monochrome map surface with a light source, and the only allowed graticule is the size of the data matrix.

See Also

Introduced before R2006a