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

一. colormap函数

可以使用colormap函数:

bash 复制代码
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为:

bash 复制代码
colormap(othercolor('PuBu6'))

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

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

如何设置全局使用:

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

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

相关推荐
fanruitian8 分钟前
python 进程 线程
java·前端·python
Lsetea13 分钟前
curl访问HTTPS返回304却没有正文:条件请求、缓存与证书验收排查
linux·http·https·ssl证书·curl
ZoeLandia13 分钟前
React03:useState 与不可变更新
前端·react.js·typescript·react
蒲公英内测分发29 分钟前
智能手表卖出去后,包装、说明书和官网里的 App 下载入口怎么统一?
前端·人工智能·测试工具·智能家居·智能硬件·智能手表
NEAI_N30 分钟前
嵌入式Linux调试:microcom 串口工具
linux
溪语流沙37 分钟前
【Web全栈进阶】监控与告警:线上系统的“体检报告”
前端·vue.js·python·fastapi
叼烟扛炮40 分钟前
Linux 学习笔记(九):自动化构建神器 Make 与 Makefile
linux·运维·服务器
鬼手点金41 分钟前
单轮对话:最简单的 API 调用
java·服务器·前端·javascript·react.js·servlet·tomcat
lisanmengmeng43 分钟前
监控Kubernetes集群的GPU资源(三)
linux·容器·kubernetes
蜡笔羊驼1 小时前
ModuleNotFoundError: No module named ‘torchvision.transforms.functional_tensor‘
linux·人工智能·python