12.07.2015 Views

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Surface PropertiesButtonDownFcn stringButton press callback routine. A callback routine that executes whenever youpress a mouse button while the pointer is over the surface object. Define thisroutine as a string that is a valid <strong>MATLAB</strong> expression or the name of an M-file.The expression executes in the <strong>MATLAB</strong> workspace.CDatamatrixVertex colors. A matrix containing values that specify the color at every pointin ZData. If you set the FaceColor property to texturemap, CData does not needto be the same size as ZData. In this case, <strong>MATLAB</strong> maps CData to conform tothe surface defined by ZData.You can specify color as indexed values or true color. Indexed color dataspecifies a single value for each vertex. These values are either scaled to maplinearly into the current colormap (see caxis) or interpreted directly as indicesinto the colormap, depending on the setting of the CDataMapping property.True color defines an RGB value for each vertex. If the coordinate data (XDatafor example) are contained in m-by-n matrices, then CData must be an m-by-n-3array. The first page contains the red components, the second the greencomponents, and the third the blue components of the colors.On computer displays that cannot display true color (e.g., 8-bit displays),<strong>MATLAB</strong> uses dithering to approximate the RGB triples using the colors in thefigure’s Colormap and Dithermap. By default, Dithermap uses thecolorcube(64) colormap. You can also specify your own dithermap.CDataMapping{scaled} | directDirect or scaled color mapping. This property determines how <strong>MATLAB</strong>interprets indexed color data used to color the surface. (If you use true colorspecification for CData, this property has no effect.)• scaled – transform the color data to span the portion of the colormapindicated by the axes CLim property, linearly mapping data values to colors.See the caxis reference page for more information on this mapping.• direct – use the color data as indices directly into the colormap. The colordata should then be integer values ranging from 1 to length(colormap).<strong>MATLAB</strong> maps values less than 1 to the first color in the colormap, andvalues greater than length(colormap) to the last color in the colormap.Values with a decimal portion are fixed to the nearest, lower integer.2-483

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!