Main Content

surflsrm

3-D lighted shaded relief of geolocated data grid on axesm-based map

Syntax

surflsrm(lat,long,Z)
surflsrm(lat,long,Z,[azim elev])
surflsrm(lat,long,Z,[azim elev],cmap)
surflsrm(lat,long,Z,[azim elev],cmap,clim)
h = surflsrm(...)

Description

surflsrm(lat,long,Z) displays the geolocated data grid, colored according to elevation and surface slopes. The current axes must have a valid map projection definition.

surflsrm(lat,long,Z,[azim elev]) displays the geolocated data grid with the light coming from the specified azimuth and elevation. Lighting is applied before the data is projected. Angles are in degrees, with the azimuth measured clockwise from North, and elevation up from the zero plane of the surface. By default, the direction of the light source is east (90º azimuth) at an elevation of 45º.

surflsrm(lat,long,Z,[azim elev],cmap) displays the geolocated data grid using the provided colormap. The number of grayscales is chosen to keep the size of the shaded colormap below 256. By default, the colormap is constructed from 16 colors and 16 grays. If the vector of azimuth and elevation is empty, the default locations are used.

surflsrm(lat,long,Z,[azim elev],cmap,clim) uses the provided color axis limits, which are, by default, automatically computed from the data.

h = surflsrm(...) returns the handle to the surface drawn.

Examples

collapse all

Load a geolocated data grid into the workspace. The map1 variable contains elevation data.

load("mapmtx.mat","lt1","lg1","map1")

Create a colormap from the elevation data by using the demcmap function. Apply a white color to the sea instead of shades of blue. Use the default number of colors and the default land colors by specifying the second and fourth arguments as an empty array ([]).

w = [1 1 1];
cmap = demcmap(map1,[],w,[]);

Create a map using a loximuthal projection. Then, display the elevation data using a lighted shaded relief map. Use the default light source by specifying the fourth argument as an empty array.

figure
axesm loximuth
surflsrm(lt1,lg1,map1,[],cmap)

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

Tips

This function effectively multiplies two colormaps, one with color based on elevation, the other with a grayscale based on the slope of the surface, to create a new colormap. This produces an effect similar to using a light on a surface, but with all of the visible colors actually in the colormap. Lighting calculations are performed on the unprojected data.

Version History

Introduced before R2006a