当前位置:网站首页>matlab读取多张fig图然后合并为一张图(子图的形式)
matlab读取多张fig图然后合并为一张图(子图的形式)
2022-04-23 03:53:00 【subtitle_】
引言
多次做实验得到了一些实验的图像,matlab导出保存为了fig格式,想读取多张fig图然后合成为一张大图(子图的形式),查了一些资料,记录一些自己的思考和体会。

1.代码
for i=1:10
%打开的fig文件酌情修改路径
hf(i)=open(['.\fig\sin-x1-test_',num2str(i),'.fig']);%打开fig
fig(i)=get(hf(i), 'CurrentAxes');%获取绘制的图像
end
%新建一个图窗
figure
for i=1:10
%看要绘制多少行多少列酌情改变
subplot(2,5,i);%第i个子图
axChildren = get(fig(i),'Children');%获取绘制的图像
copyobj(axChildren, gca);%复制到当前图窗里
close(hf(i));%关掉已经复制的图像
%下面是对图片进行设置,请酌情修改
title(['S曲线第',num2str(i),'次测试']);%绘制子图标题
xlabel('Angle(\circ)');%绘制子图x标签
ylabel('Center WaveLength Change(nm)');%绘制子图y标签
yaxis([-0.05,0.2])%绘制子图y的范围
xticks([0 20 40 60 80 100]);%绘制子图刻度
end
2.最终效果如图

版权声明
本文为[subtitle_]所创,转载请带上原文链接,感谢
https://blog.csdn.net/subtitle_/article/details/124317501
边栏推荐
- 2021-09-03 crawler template (only static pages are supported)
- As a code farmer, what kind of experience is it that a girlfriend can code better than herself?
- CRF based medical entity recognition baseline
- php导出Excel表格
- 标识符、关键字、数据类型
- Vscode download and installation + running C language
- A sword is a sword. There is no difference between a wooden sword and a copper sword
- Paddlepaddle does not support arm64 architecture.
- Mysql出现2013 Lost connection to MySQL server during query
- Design and implementation of redis (2): how to handle expired keys
猜你喜欢

ROS series (IV): ROS communication mechanism series (6): parameter server operation

51 single chip microcomputer: D / a digital to analog conversion experiment

Network principle | connection management mechanism in TCP / IP important protocol and core mechanism

ROS series (4): ROS communication mechanism series (4): topic communication practice

The art of concurrent programming (6): explain the principle of reentrantlock in detail

网络原理 | TCP/IP中的连接管理机制 重要协议与核心机制

Key point detection of human hand based on mediapipe

创下国产手机在海外市场销量最高纪录的小米,重新关注国内市场

Source code and update details of new instance segmentation network panet (path aggregation network for instance segmentation)

Design and implementation of redis (6): how redis achieves high availability
随机推荐
[AI vision · quick review of robot papers today, issue 29] Mon, 14 Feb 2022
Cmake qmake simple knowledge
Basic introduction to spot gold
抽象类、接口、常用关键字
中国移动日赚2.85亿很高?其实是5G难带来更多利润,那么钱去哪里了?
Leetcode 617 merge binary tree
Identificateur, mot - clé, type de données
Now is the best time to empower industrial visual inspection with AI
Use the thread factory to set the thread name in the thread pool
How to introduce opencv into cmake project
The difference between lists, tuples, dictionaries and collections
深度學習筆記(二)——激活函數原理與實現
[AI vision · quick review of robot papers today, issue 30] Thu, 14 APR 2022
Vs studio modifies C language scanf and other errors
Does China Mobile earn 285 million a day? In fact, 5g is difficult to bring more profits, so where is the money?
Design and implementation of redis (5): master-slave replication strategy and optimization
Machine translation baseline
RuntimeError: output with shape [4, 1, 512, 512] doesn‘t match the broadcast shape[4, 4, 512, 512]
Mechanical design knowledge point planning
The art of concurrent programming (2): synchronized usage scenarios