matlab:指定颜色的曲面图
我有一个2D矩阵,其中每个元素的值为0、1或2 我使用matlab:指定颜色的曲面图,matlab,figure,Matlab,Figure,我有一个2D矩阵,其中每个元素的值为0、1或2 我使用曲面绘制它: surface(img) Matlab会自动为“0”像素绘制蓝色,为“1”绘制绿色,为“2”绘制红色。现在我想更改默认颜色,例如对“0”像素使用白色。我该怎么做 [0 0 0]为黑色,[1 1 1]为白色,[0.5 0.5 0.5]为灰色: MAP = [1 1 1;0.5 0.5 0.5; 0 0 0]; surface(img),colormap(MAP) [0 0 0]为黑色,[1 1 1]为白色,[0.5 0.5 0
曲面绘制它
:
surface(img)
Matlab会自动为“0”像素绘制蓝色,为“1”绘制绿色,为“2”绘制红色。现在我想更改默认颜色,例如对“0”像素使用白色。我该怎么做 [0 0 0]为黑色,[1 1 1]为白色,[0.5 0.5 0.5]为灰色:
MAP = [1 1 1;0.5 0.5 0.5; 0 0 0];
surface(img),colormap(MAP)
[0 0 0]为黑色,[1 1 1]为白色,[0.5 0.5 0.5]为灰色:
MAP = [1 1 1;0.5 0.5 0.5; 0 0 0];
surface(img),colormap(MAP)
[0 0 0]为黑色,[1 1 1]为白色,[0.5 0.5 0.5]为灰色:
MAP = [1 1 1;0.5 0.5 0.5; 0 0 0];
surface(img),colormap(MAP)
[0 0 0]为黑色,[1 1 1]为白色,[0.5 0.5 0.5]为灰色:
MAP = [1 1 1;0.5 0.5 0.5; 0 0 0];
surface(img),colormap(MAP)
这就是我要找的。谢谢这就是我要找的。谢谢这就是我要找的。谢谢这就是我要找的。谢谢