当前位置:网站首页>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()
不想看了,摆烂
边栏推荐
猜你喜欢

关于#sql shell#的问题,如何解决?
ROS通信 —— 服务(Service)通信](/img/4d/4657f24bd7809abb4bdc4b418076f7.png)
[ROS](10)ROS通信 —— 服务(Service)通信

C language implements a simple number guessing game

【解密】OpenSea免费创造的NFT都没上链竟能出现在我的钱包里?

Advanced Numbers_Review_Chapter 1: Functions, Limits, Continuity

nodeJs--encapsulate routing

剑指offer专项突击版第20天

Unleashing the engine of technological innovation, Intel joins hands with ecological partners to promote the vigorous development of smart retail

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

Go 微服务开发框架 DMicro 的设计思路
随机推荐
RAID磁盘阵列
627. Change of gender
2022-08-04: Input: deduplicated array arr, the numbers in it only contain 0~9.limit, a number.Return: The maximum number that can be spelled out with arr if the requirement is smaller than limit.from
select tag custom style
线上MySQL的自增id用尽怎么办?
力扣-相同的树
shell语句修改txt文件或者sh文件
Simple implementation of YOLOv7 pre-training model deployment based on OpenVINO toolkit
力扣-二叉树的前序遍历、中序遍历、后序遍历
Note that Weifang generally needs to pay attention to issuing invoices
ARM Mailbox
C student management system Find student nodes based on student ID
undo问题
关于#sql shell#的问题,如何解决?
[深入研究4G/5G/6G专题-51]: URLLC-16-《3GPP URLLC相关协议、规范、技术原理深度解读》-11-高可靠性技术-2-链路自适应增强(根据无线链路状态动态选择高可靠性MCS)
select 标签自定义样式
Common hardware delays
重新审视分布式系统:永远不会有完美的一致性方案……
百日刷题计划 ———— DAY2
RAID disk array