关于matlab中的colormap问题

来源:互联网 发布:小米盒子刷linux 编辑:程序博客网 时间:2024/04/26 06:21

matlab画图后,如果想将不同的值用不同的颜色表示,可以使用colormap这个函数。matlab自带的colormap有很多选项


其中最常用的是第一个,也是默认的选项。那么它是怎么得来的呢?

jet ranges from blue to red, and passes through the colors cyan, yellow, and orange. It is a variation of the hsv colormap. The jet colormap
is associated with an astrophysical fluid jet simulation from the National Center for Supercomputer Applications. 

map=[1 0 0;0 1 0;0 0 1];%三原色colormap(map)gray(100)生成100种从黑到白的渐变色,gray(128)生成128色,默认值是256色。如colormap(gray(32))就是32色的灰度色。
在matlab命令行输入cmap=colormap,可以得到当前的色谱
cmap=colormap('jet')cmap =         0         0    0.6667         0         0    1.0000         0    0.3333    1.0000         0    0.6667    1.0000         0    1.0000    1.0000    0.3333    1.0000    0.6667    0.6667    1.0000    0.3333    1.0000    1.0000         0    1.0000    0.6667         0    1.0000    0.3333         0
即将峰值pv值平均分配到colorbar中,相应的颜色代表相应数值

 map1 = colormap('jet')

map1 =

         0         0    0.5625         0         0    0.6250         0         0    0.6875         0         0    0.7500         0         0    0.8125         0         0    0.8750         0         0    0.9375         0         0    1.0000         0    0.0625    1.0000         0    0.1250    1.0000         0    0.1875    1.0000         0    0.2500    1.0000         0    0.3125    1.0000         0    0.3750    1.0000         0    0.4375    1.0000         0    0.5000    1.0000         0    0.5625    1.0000         0    0.6250    1.0000         0    0.6875    1.0000         0    0.7500    1.0000         0    0.8125    1.0000         0    0.8750    1.0000         0    0.9375    1.0000         0    1.0000    1.0000    0.0625    1.0000    0.9375    0.1250    1.0000    0.8750    0.1875    1.0000    0.8125    0.2500    1.0000    0.7500    0.3125    1.0000    0.6875    0.3750    1.0000    0.6250    0.4375    1.0000    0.5625    0.5000    1.0000    0.5000    0.5625    1.0000    0.4375    0.6250    1.0000    0.3750    0.6875    1.0000    0.3125    0.7500    1.0000    0.2500    0.8125    1.0000    0.1875    0.8750    1.0000    0.1250    0.9375    1.0000    0.0625    1.0000    1.0000         0    1.0000    0.9375         0    1.0000    0.8750         0    1.0000    0.8125         0    1.0000    0.7500         0    1.0000    0.6875         0    1.0000    0.6250         0    1.0000    0.5625         0    1.0000    0.5000         0    1.0000    0.4375         0    1.0000    0.3750         0    1.0000    0.3125         0    1.0000    0.2500         0    1.0000    0.1875         0    1.0000    0.1250         0    1.0000    0.0625         0    1.0000         0         0    0.9375         0         0    0.8750         0         0    0.8125         0         0    0.7500         0         0    0.6875         0         0    0.6250         0         0    0.5625         0         0    0.5000         0         0


0 0
原创粉丝点击