MATLAB的Bar3函数调节渐变色(内附渐变色库.mat及.m文件免费下载链接)

一. colormap函数

可以使用colormap函数:

t1=[281.1,584.6, 884.3,1182.9,1485.2;
291.6,592.6,896,1197.75,1497.33;
293.8,596.4,898.6,1204.4,1506.4;
295.8,598,904.4,1209.0,1514.6];

bar3(t1,1)
set(gca,'XTickLabel',{'300','600','900','1200','1500'},'FontSize',10)
set(gca,'YTickLabel',{'2','3','4','5'},'FontSize',10)
zlabel('Length (mm)','FontSize',10);
xlabel('Theoretical (mm)','FontSize',10);
ylabel('F','FontSize',10);

% grid on

for i = 1:size(t1,1)
    for j = 1:size(t1,2)
        text(j*0.9, i*1.05, t1(i,j)*1.1, num2str(t1(i,j)),'FontSize',8);
    end
end

colormap summer

 colormap的颜色选择:

 二. colormap颜色的扩展

使用othercolor,修改最后一行colormap summer为:

colormap(othercolor('PuBu6'))

注意othercolor非自带函数,需要自己添加:

 相关链接:othercolor - File Exchange - MATLAB Central (mathworks.cn)

如何设置全局使用:

参见:MATLAB添加自编写.m文件或.mat数据并永久全局调用方法-CSDN博客

othercolor包括,选择自己想要的代码就可以:

相关推荐

  1. el-progress变色

    2024-05-12 14:30:04       22 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-05-12 14:30:04       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-05-12 14:30:04       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-05-12 14:30:04       18 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-05-12 14:30:04       20 阅读

热门阅读

  1. 【地道战游戏】

    2024-05-12 14:30:04       10 阅读
  2. HashMap 和 Hashtable区别的底层原理

    2024-05-12 14:30:04       15 阅读
  3. IDEA 插件,提高开发效率

    2024-05-12 14:30:04       6 阅读
  4. linux三剑客

    2024-05-12 14:30:04       7 阅读
  5. Qt窗口及QWidget类详解

    2024-05-12 14:30:04       8 阅读
  6. 蓝桥杯备战10.分巧克力

    2024-05-12 14:30:04       11 阅读
  7. 【C++语言】模板

    2024-05-12 14:30:04       8 阅读
  8. 爬虫工具you-get

    2024-05-12 14:30:04       10 阅读
  9. Leetcode 572:另一颗树的子树

    2024-05-12 14:30:04       7 阅读
  10. 【力扣】70.爬楼梯

    2024-05-12 14:30:04       7 阅读
  11. 程序员副业录制课程

    2024-05-12 14:30:04       8 阅读
  12. 指针(3)

    2024-05-12 14:30:04       9 阅读