Name

colormap — Set/get the RGB colormap of currently active figure

Calling Sequence

c = colormap(M)

Parameters

M

n by 3 matrix or a string

c

n by 3 matrix

Description

colormap(M) sets the current figure's colormap to M.

M = colormap() retrieves the current colormap. The values are in the range from 0 to 1. M is a m x 3 matrix. m is the number of colors. Color number i is given as a 3-uple M(i,1), M(i,2), M(i,3) corresponding respectively to red, green and blue intensity. For example, [0 0 0] is black, [1 1 1] is white, [1 0 0] is pure red, [.5 .5 .5] is gray, and [127/255 1 212/255] is aquamarine.

When M is a string, M can take the values

  • 'hot', 'gray', 'copper', 'cool', 'bone', 'red','green', 'blue', jet'

The colormap is used by macros which produce pseudocolor patches, such as pcolor, tripcolor, surf, trisurf, surfl, trisurfl.

Examples

pcolor(rand(10,10));
colormap gray

See Also

caxis

Authors

add the author name and author reference
add another author name and it's reference

Bibliography

Add here the function bibliography

Used Functions

Add here the Scilab, C,... used code references