How can I plot an existing MATLAB plots all in one figure using SUBPLOT
Afficher commentaires plus anciens
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.
Réponse acceptée
Plus de réponses (1)
Doug Hull
le 12 Jan 2011
3 commentaires
Francesca Pisani
le 3 Août 2023
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
le 3 Août 2023
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
Catégories
En savoir plus sur Graphics Object Properties dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


