How can I plot an existing MATLAB plots all in one figure using SUBPLOT
显示 更早的评论
I have four figures which are already plotted by another user, but I do not have the commands that he used to plot them. I am trying to plot them all in one figure using SUBPLOT command.
采纳的回答
更多回答(1 个)
Doug Hull
2011-1-12
3 个评论
Francesca Pisani
2023-8-3
This does not work for me. I get error:
Error using matlab.ui.Figure/get
Invalid or deleted object.
Error in microctd_turb_20apr (line 653)
hc = get(hf(i),'children')
@Francesca Pisani this code runs fine on online server as showed here:
Do not close manually he figure when it still running.
hf(1) = figure(1)
plot(peaks);
hf(2) = figure(2)
plot(membrane)
hf(3) = figure(3)
ha(1) = subplot(1,2,1);
ha(2) = subplot(1,2,2);
for i = 1:2
hc = get(hf(i),'children')
hgc = get(hc, 'children');
set(hgc, 'parent',ha(i));
end
Francesca Pisani
2023-8-3
Thank you, here it works, but if I apply this code to my need of creating a subplots with 4x2 figures it doesn't work. Please, if you could help me, I've just uploaded my question here https://it.mathworks.com/matlabcentral/answers/2004122-how-to-get-subplots-made-of-a-group-of-already-existing-fig
类别
在 帮助中心 和 File Exchange 中查找有关 Graphics Object Properties 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


