Could not set the Colormap. Reason:
Could not set the Colormap. Reason:
Could not set the Colormap. Reason:
Re: Could not set the Colormap. Reason:
solution :
A colormap is a matrix of values that define the colors for graphics objects such as surface, image, and patch objects. MATLAB® draws the objects by mapping data values to colors in the colormap.
Colormaps can be any length, but must be three columns wide. Each row in the matrix defines one color using an RGB triplet. An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. Typically, the intensities are double or single values in the range [0, 1]. A value of 0 indicates no color and a value of 1 indicates full intensity. For example, this command creates a colormap that has five colors: black, red, green, blue, and white.
To change the color scheme of a visualization, call the colormap function to change the colormap of the containing axes or figure. For example, the following commands create a surface plot and set the colormap of the figure to mymap.
https://www.mathworks.com/help/matlab/ref/colormap.html
A colormap is a matrix of values that define the colors for graphics objects such as surface, image, and patch objects. MATLAB® draws the objects by mapping data values to colors in the colormap.
Colormaps can be any length, but must be three columns wide. Each row in the matrix defines one color using an RGB triplet. An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. Typically, the intensities are double or single values in the range [0, 1]. A value of 0 indicates no color and a value of 1 indicates full intensity. For example, this command creates a colormap that has five colors: black, red, green, blue, and white.
Code: Select all
mymap = [0 0 0
1 0 0
0 1 0
0 0 1
1 1 1];
Code: Select all
surf(peaks)
colormap(mymap)
https://www.mathworks.com/help/matlab/ref/colormap.html
Who is online
Users browsing this forum: No registered users and 3 guests