When you use a colormap, the entry-number used always scales linearly between the upper and lower limit established on the color axes (caxis) .
One approach is thus to create a colormap that conceptually spans the entire range of your data, but you repeat colors in the upper 1/3 (or as appropriate). It is completely valid to use a colormap that goes something like
black
red/8
2*red/8
3*red/8
4*red/8
yellow
yellow
yellow
blue
If you are using a sufficiently old MATLAB on MS Windows then you are limited to 256 entries in a colormap; other operating systems and newer MATLAB for Windows permit 65536 entries.
Another approach is to do the color mapping yourself. You can, for example, discretize() the Z range to get bin numbers, and ind2rgb(binNumbers, your_color_map) to get an RGB image. You can then set that as the CData of the surf() -- though I find that texture mapping like this is often easier to accomplish using warp() instead of surf() .
Best Answer