当前位置:网站首页>Matlab drawing 3
Matlab drawing 3
2022-08-05 02:33:00 【Ten thousand years old bamboo】
Matlab画图 3
1.练习:Complete the effect of the picture below

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
适用场景:When a multi-dimensional image is difficult to visually reflect changes in values,利用imagescThe function displays the image using color;ColorBarIt acts as a legend in the figure,ColorMapYou can adjust the color temperature
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()The difference is that there will be one more at the bottomcontour图像
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()
不想看了,摆烂
边栏推荐
- Apache DolphinScheduler新一代分布式工作流任务调度平台实战-中
- C学生管理系统 据学号查找学生节点
- Access Characteristics of Constructor under Inheritance Relationship
- [Fortune-telling-60]: "The Soldier, the Tricky Way"-2-Interpretation of Sun Tzu's Art of War
- Cloud Native (32) | Introduction to Platform Storage System in Kubernetes
- leetcode 15
- SuperMap iDesktop.Net之布尔运算求交——修复含拓扑错误复杂模型
- lua learning
- Regular expression to match a certain string in the middle
- 云原生(三十二) | Kubernetes篇之平台存储系统介绍
猜你喜欢

【C语言】详解栈和队列(定义、销毁、数据的操作)

View handler 踩坑记录

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

Common hardware delays

Matlab画图3

剑指offer专项突击版第20天

Cloud Native (32) | Introduction to Platform Storage System in Kubernetes

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

甘特图来啦,项目管理神器,模板直接用
![[ROS] (10) ROS Communication - Service Communication](/img/4d/4657f24bd7809abb4bdc4b418076f7.png)
[ROS] (10) ROS Communication - Service Communication
随机推荐
Error: Not a signal or slot declaration
虚拟内存原理与技术
力扣-相同的树
ARM Mailbox
DAY22:sqli-labs 靶场通关wp(Less01~~Less20)
SuperMap支持的国产环境汇总
C学生管理系统 据学号查找学生节点
Gantt chart is here, project management artifact, template is used directly
mysql树状结构查询问题
编译预处理等细节
02 [Development Server Resource Module]
js中try...catch和finally的用法
Introduction to SDC
北斗三号短报文终端露天矿山高边坡监测方案
DAY23:命令执行&代码执行漏洞
RAID disk array
The 22-07-31 weeks summary
常见的硬件延迟
散列表的查找(哈希表)
QT语言文件制作