- 积分
 - 2575
 
	- 贡献
 -  
 
	- 精华
 
	- 在线时间
 -  小时
 
	- 注册时间
 - 2018-9-7
 
	- 最后登录
 - 1970-1-1
 
 
 
 
 
 
 | 
	
 
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册 
 
 
 
x
 
 本帖最后由 huihuang 于 2023-6-12 09:27 编辑  
 
这是我在论坛的第一个帖子,如有不正确的做法,希望大家包涵,并指出 
没有找到MATLAB相关的命令,加上老师的作业要求,所以自己写了一个。 
调用示例1:
 - tick=-20:5:20;
 
 - color=[69 117 180;116 173 203;171 217 233;254 224 144;253 174 77;244 109 67;215 48 39;165 0 38]/255;
 
 - mode='h';
 
 - colorbarn(tick,color,'Mode',mode)
 
  复制代码 对应图像:colorbar_example.png 
 
 
调用示例2:- color=[131 0 162;160 0 198;109 0 219;31 60 249;0  160 230;0 198 198;0 209 139;0 219 0;160 230  51;230 219 51;230 175 45;239 130 41;239 0 0;219  0 98;255 1 118]/255;
 
  复制代码 对应图像:contourf_example.png 
 
 
 
 
 
% -------------------------------------------------------------------------------------------------------- 
2022-07-14更新: 
上传测试颜色文件(Color_paper_corr.mat) 
优化了colorbarn函数结构 
新增了参数:'Delete',可以删除某一颜色,如下图所示: 
- load Color_paper_corr.mat
 
 - figure('Position',[100 100 1280 260])
 
  
- c1=colorbarn(-1:.1:1,Color,'mode','h');
 
 - set(c1,'Position',[0.1 0.6 0.8 0.15])
 
  
- c2=colorbarn(-1:.1:1,Color,'mode','h','Delete',11);
 
 - set(c2,'Position',[0.1 0.2 0.8 0.15])
 
  复制代码 
 
 
 
% -------------------------------------------------------------------------------------------------------- 
2023-05-24更新: 
新增参数:'CuspType',可以设置某一端不是尖端样式
 - load Color_paper_corr.mat
 
 - figure('Position',[100 100 1280 260])
 
  复制代码 
 
 
 
以上,祝您身体健康! 
 
 |   
 
评分
- 
查看全部评分
 
 
 
 
 
 |