当前位置:网站首页>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()
不想看了,摆烂
边栏推荐
- Images using redis cache Linux master-slave synchronization server hard drive full of moved to the new directory which points to be modified
- Solve connect: The requested address is not valid in its context
- 01 【前言 基础使用 核心概念】
- SuperMap支持的国产环境汇总
- 蚁剑高级模块开发
- 01 [Foreword Basic Use Core Concepts]
- LeetCode uses the minimum cost to climb the stairs----dp problem
- C学生管理系统 头添加学生节点
- 甘特图来啦,项目管理神器,模板直接用
- nodeJs--encapsulate routing
猜你喜欢
随机推荐
QT语言文件制作
【存储】曙光存储DS800-G35 ISCSI各映射LUN给服务器
ARM Mailbox
Access Characteristics of Constructor under Inheritance Relationship
C student management system head to add a student node
甘特图来啦,项目管理神器,模板直接用
The 2022 EdgeX China Challenge will be grandly opened on August 3
北斗三号短报文终端露天矿山高边坡监测方案
J9数字货币论:web3的创作者经济是什么?
力扣-相同的树
Error: Not a signal or slot declaration
Intel XDC 2022 Wonderful Review: Build an Open Ecosystem and Unleash the Potential of "Infrastructure"
行业案例|世界 500 强险企如何建设指标驱动的经营分析系统
js中try...catch和finally的用法
Pisanix v0.2.0 发布|新增动态读写分离支持
继承关系下构造方法的访问特点
关于#sql shell#的问题,如何解决?
[In-depth study of 4G/5G/6G topic-51]: URLLC-16-"3GPP URLLC related protocols, specifications, and technical principles in-depth interpretation"-11-High reliability technology-2-Link adaptive enhancem
QT MV\MVC结构
01 【前言 基础使用 核心概念】









