Colormap is mainly used in MATLAB to change the color display of graphics. Its usage is as follows:
colormap(MAP) uses the MAP matrix to map the color map of the current graphic.
colormap('default') The default setting is JET.
MAP = colormap gets the current colormap matrix.
colormap(AX,...) applies the colormap to the graphic corresponding to the AX coordinates, not the current graphic.
In addition, the input of colormap is a matrix (n*3) containing arbitrary rows but only three columns. The colors in the matrix are numbers between 0-1, and each Three numbers in a row will be mapped to a color. The three values correspond to the intensity of the three color channels of R (red), G (green), and B (blue). By changing the intensity of the three channel values, All the colors we need can be mapped. For example, (0,0,0) is mapped to black and (1,1,1) is mapped to white.
The above is the detailed content of How to use colormap. For more information, please follow other related articles on the PHP Chinese website!