当前位置:网站首页>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()
不想看了,摆烂
边栏推荐
- 程序员的七夕浪漫时刻
- The 22-07-31 weeks summary
- ARM Mailbox
- What should I do if the self-incrementing id of online MySQL is exhausted?
- 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
- nodeJs--封装路由
- 回顾51单片机
- VSCode Change Default Terminal 如何修改vscode的默认terminal
- 在这个超连接的世界里,你的数据安全吗
- 力扣-二叉树的前序遍历、中序遍历、后序遍历
猜你喜欢
蚁剑高级模块开发
select 标签自定义样式
nodeJs--encapsulate routing
DAY22:sqli-labs 靶场通关wp(Less01~~Less20)
线上MySQL的自增id用尽怎么办?
Using OpenVINO to implement the flying paddle version of the PGNet inference program
【OpenCV 图像处理2】:OpenCV 基础知识
lua learning
Simple implementation of YOLOv7 pre-training model deployment based on OpenVINO toolkit
特殊矩阵的压缩存储
随机推荐
开源协议说明LGPL
select 标签自定义样式
How OpenGL works
【genius_platform软件平台开发】第七十六讲:vs预处理器定义的牛逼写法!!!!(其他组牛逼conding人员告知这么配置来取消宏定义)
C language diary 9 3 kinds of statements of if
The 22-07-31 weeks summary
Regular expression to match a certain string in the middle
Chinese characters to Pinyin
[机缘参悟-60]:《兵者,诡道也》-2-孙子兵法解读
View handler 踩坑记录
浅谈数据安全治理与隐私计算
torch.roll()
Solve connect: The requested address is not valid in its context
Images using redis cache Linux master-slave synchronization server hard drive full of moved to the new directory which points to be modified
金仓数据库如何验证安装文件平台正确性
Lexicon - the maximum depth of a binary tree
Quickly learn chess from zero to one
[深入研究4G/5G/6G专题-51]: URLLC-16-《3GPP URLLC相关协议、规范、技术原理深度解读》-11-高可靠性技术-2-链路自适应增强(根据无线链路状态动态选择高可靠性MCS)
J9数字货币论:web3的创作者经济是什么?
解决connect: The requested address is not valid in its context