matlab figure中的图像根据每点的pixel值可以显示为rgb色彩的图像,
但是要在colorbar中显示,则需要将图像的rgb值通过函数映射,
比如:
jet hsv hot cool spring summer autumn winter gray bone
copper pink lines 产生一个单调的映射才行(具体的help colormap);
函数调用时:
figure,[x,y,z]=peaks;
mesh(x,y,z);
colormap(cool)
axis([-3 3 -3 3 -6 8])
colorbar
mesh(x,y,z);
colormap(cool)
axis([-3 3 -3 3 -6 8])
colorbar
修改colormap(cool),中的cool为其他映射即可。
本文探讨了在Matlab中使用figure绘制图像并应用不同colormap色彩映射的方法,包括如何通过函数调整色彩映射以适应具体需求,并展示了通过'peaks'函数创建三维网格图像并应用'cool'映射的实例。
1434

被折叠的 条评论
为什么被折叠?



