matlab根据单调增加的用户定义范围设置颜色贴图

收录时间:2020-07-29
资源分类:Matlab 工具:MATLAB 7.10 (R2010a)

matlab根据单调增加的用户定义范围设置颜色贴图.

custom colormap

This function is useful if you don't want to use the linear scaled colormap that are the default in Matlab.

   

USAGE:

         CUSTOMCMAP(cbar_labels,user_cmap,minMaxValues)

                    

% INPUT:

% cbar_labels - Vector (n x 1) of monotonically increasing ranges of data

% user_cmap - Matrix ((n-1) x 3) of colormap you want to see

% minMaxValues - Vector (2 x 1) of minimum and maximum value of data

% that is plotted

%

%

% EXAMPLES:

data = rand(10,10);

minVal = min(min(data));

maxVal = max(max(data));

image(data,'CDataMapping','scaled');

cbar_labels = [0 0.12 0.2 0.3 0.5 0.6 0.75 0.8 1]; % user defined ranges

user_cmap = jet(8); % user defined colormap

customcmap(cbar_labels,user_cmap,[minVal maxVal])

 

Bug and comments are welcome.

文件下载列表
customcmap.zip (2.31KB)  
附件内容(只显示2中的1个)
customcmap.m  
更多

目前尚无评论

用户反馈   关于我们
Copyright (©) ZHIHUISHI.COM 2013 All Rights Reserved.
京ICP备18060134号-2