Mapping Toolbox | ![]() ![]() |
Contour colormap and colorbar for surfaces
Syntax
contourcmap(cdelta,
cmap,
property,value,...)
Description
contourcmap(cdelta,cmap) creates a contour colormap for the current axes. A contour colormap is a colormap with color changes aligned to the color data. If cdelta is a scalar, contours are generated at multiples of cdelta. If cdelta is a vector of evenly spaced values, contours are generated at those values. The string input cmap is the name of the colormap function used in the surface. Valid entries for cmap include 'pink', 'hsv', 'jet', or any similar colormap function.
contourcmap(cdelta,cmap,property,value,...) allows you to add a colorbar and control the colorbar's properties. You turn the colorbar on with the property-value pair 'Colorbar' and 'on'. The location of the colorbar is controlled by the 'Location' property. Valid entries for Location are 'vertical' (the default) or 'horizontal'. Properties 'TitleString', 'XLabelString', 'YLabelString' and 'ZLabelString' set the respective strings. Property 'ColorAlignment' controls whether the colorbar labels are centered on the color bands or the color breaks. Valid values for ColorAlignment are 'center' or 'ends'. Property 'SourceObject' controls which object is used to determine the color limits for the colormap. The SourceObject value is the handle of a currently displayed object. If omitted, gca is used. Other valid property-value pairs are any properties and values that can be applied to the title and labels of the colorbar axes.
hcb = contourcmap(...) returns a handle to the colorbar.
Example
Create a colormap and set color limits to make the color changes occur at multipled of one for the peaks surface.
Add a colorbar, controlling the labels and font properties.
See Also
contourfm |
Filled contour map. |
lcolorbar |
Labeled color bar. |
demcmap |
Digital elevation data color map. |
![]() | contourm | contourfm | ![]() |