当前位置:网站首页>Matlab画图3
Matlab画图3
2022-08-05 02:31:00 【万年老竹】
Matlab画图 3
1.练习:完成下图的效果

G=[46 38 29 24 13]; S=[29 27 17 26 8]; B=[29 23 19 32 7];
h=bar(1:5,[G' S' B']);
set(h(1),'FaceColor',[1 1 0]);
set(h(2),'FaceColor',[0.7 0.7 0.7]);
set(h(3),'FaceColor',[1 0.6 0.1]);
title('Medal count for top 5countries in 2012 Olympics');
ylabel('Number of medals'); xlabel('Country');
set(gca, 'XTickLabel',{'USA','CHN','GBR','RUS','KCR'});
legend('Gold','Silver','Bronze');
结果如下

2.imagesc函数、color bar与color map
适用场景:多维图像难以直观反映值的变化时,利用imagesc函数使用颜色显示图像;ColorBar在图中起到图例的作用,ColorMap则可以调整色温
eg:
[x,y]=meshgrid(-3:.2:3,-3:.2:3);
z=x.^2+x.*y+y.^2;surf(x,y,z);box on;
set(gca,'FontSize',16);zlabel('z');
xlim([-4 4]);xlabel('x');ylim([-4 4]);ylabel('y');colormap('turbo');
imagesc(z);axis square;xlabel('x');ylabel('y');
colorbar;colormap('turbo');
结果如下 
3.3D绘图 3D Plots
4.mesh()与surf()
mesh是表格,surface是表面
eg:
x=-3.5:0.2:3.5;y=-3.5:0.2:3.5;
[X,Y]=meshgrid(x,y);
Z=x.*exp(-X.^2-Y.^2);
subplot(1,2,1);mesh(X,Y,Z);
subplot(1,2,2);surf(X,Y,Z);
结果如下
meshc()和surfc()与mesh()与surf()的区别在于底部会多一个contour图像
5.Various Countour Plots
eg:
x=-3.5:0.2:3.5;y=-3.5:0.2:3.5;
[X,Y]=meshgrid(x,y);
Z=x.*exp(-X.^2-Y.^2);
subplot(1,2,1);mesh(X,Y,Z);
axis square
subplot(1,2,2);contour(X,Y,Z);
axis square;
结果如下:

6.view(),light(),patch()
不想看了,摆烂
边栏推荐
- Solve connect: The requested address is not valid in its context
- LPQ (local phase quantization) study notes
- Access Characteristics of Constructor under Inheritance Relationship
- 线性表的查找
- 浅谈数据安全治理与隐私计算
- C student management system Insert the student node at the specified location
- Matlab map with color representation module value size arrow
- post-study program
- Jincang database KingbaseES V8 GIS data migration solution (3. Data migration based on ArcGIS platform to KES)
- 转:查尔斯·汉迪:你是谁,比你做什么更重要
猜你喜欢

View handler stepping record

Apache DolphinScheduler新一代分布式工作流任务调度平台实战-中

常见的硬件延迟

The 2022 EdgeX China Challenge will be grandly opened on August 3

Flink 1.15.1 集群搭建(StandaloneSession)

LPQ(局部相位量化)学习笔记

【genius_platform软件平台开发】第七十六讲:vs预处理器定义的牛逼写法!!!!(其他组牛逼conding人员告知这么配置来取消宏定义)

C语言日记 9 if的3种语句

在这个超连接的世界里,你的数据安全吗

优化Feed流遭遇拦路虎,是谁帮百度打破了“内存墙”?
随机推荐
优化Feed流遭遇拦路虎,是谁帮百度打破了“内存墙”?
[Decryption] Can the NFTs created by OpenSea for free appear in my wallet without being chained?
Intel XDC 2022 Wonderful Review: Build an Open Ecosystem and Unleash the Potential of "Infrastructure"
SuperMap iDesktop.Net之布尔运算求交——修复含拓扑错误复杂模型
2022 EdgeX中国挑战赛8月3日即将盛大开幕
How do programmers without objects spend the Chinese Valentine's Day
How to simply implement the quantization and compression of the model based on the OpenVINO POT tool
[深入研究4G/5G/6G专题-51]: URLLC-16-《3GPP URLLC相关协议、规范、技术原理深度解读》-11-高可靠性技术-2-链路自适应增强(根据无线链路状态动态选择高可靠性MCS)
post-study program
释放技术创新引擎,英特尔携手生态合作伙伴推动智慧零售蓬勃发展
nodeJs--encapsulate routing
C student management system head to add a student node
Solve connect: The requested address is not valid in its context
Jincang database KingbaseES V8 GIS data migration solution (3. Data migration based on ArcGIS platform to KES)
lua学习
线上MySQL的自增id用尽怎么办?
SuperMap支持的国产环境汇总
【解密】OpenSea免费创造的NFT都没上链竟能出现在我的钱包里?
J9数字货币论:web3的创作者经济是什么?
Live preview | 30 minutes started quickly!Look at credible distributed AI chain oar architectural design