3-D Visualization Previous page   Next Page

Example -- Mapping Surface Curvature to Color

The Laplacian of a surface plot is related to its curvature; it is positive for functions shaped like i^2 + j^2 and negative for functions shaped like -(i^2 + j^2). The function del2 computes the discrete Laplacian of any matrix. For example, use del2 to determine the color for the data returned by peaks.

Creating a color array by applying the Laplacian to the data is useful because it causes regions with similar curvature to be drawn in the same color.

Compare this surface coloring with that produced by the statements

which use the same colormap, but map regions with similar z value (height above the x-y plane) to the same color.

Previous page  Indexed Color Surfaces -- Direct and Scaled Colormapping Altering Colormaps Next page

© 1994-2005 The MathWorks, Inc.