Graphics Previous page   Next Page

Axes Color Limits -- the CLim Property

Many of the 3-D graphics functions produce graphs that use color as another data dimension. For example, surface plots map surface height to color. The color limits control the limits of the color dimension in a way analogous to setting axis limits.

The axes CLim property controls the mapping of image, patch, and surface CData to the figure colormap. CLim is a two-element vector [cmin cmax] specifying the CData value to map to the first color in the colormap (cmin) and the CData value to map to the last color in the colormap (cmax). Data values in between are linearly transformed from the second to the next to last color, using the expression

cm_length is the length of the colormap. When CLimMode is auto, MATLAB sets CLim to the range of the CData of all graphics objects within the axes. However, you can set CLim to span any range of values. This allows individual axes within a single figure to use different portions of the figure's colormap. You can create colormaps with different regions, each used by a different axes.

See the caxis command for more information on color limits.

See Example -- Simulating Multiple Colormaps in a Figure for an example that calculates color limits.


Previous page  Specifying Axes Colors Example -- Simulating Multiple Colormaps in a Figure Next page

© 1994-2005 The MathWorks, Inc.