Effacer les filtres
Effacer les filtres

How to merge two .fig images using hold on command?

2 vues (au cours des 30 derniers jours)
Loren99
Loren99 le 6 Sep 2022
Modifié(e) : Loren99 le 8 Sep 2022
Hi everyone! I need a help with the command hold on. In particular, I would like to plot both voronoi70.fig, voronoi80.fig and this line here:
plot3(new_xedges_of_connection,new_yedges_of_connection,new_zedges_of_connection,'b')
so I have done this code:
openfig('voronoi70.fig');
hold on
openfig('voronoi80.fig');
...
...
...
...
...
plot3(new_xedges_of_connection,new_yedges_of_connection,new_zedges_of_connection,'b')
hold off
But at the end I obtain a plot with only voronoi80 and with what is contained in the command plot3. How can I include also voronoi70? Thanks in advance

Réponse acceptée

Walter Roberson
Walter Roberson le 6 Sep 2022
You cannot use hold on to merge figures.
fig70 = openfig('voronoi70.fig');
fig80 = openfig('voronoi80.fig');
mfig = copyobj(fig70, groot);
copyobj(get(fig80, 'children'), mfig);
ax = gca(mfig);
hold(ax, 'on');
title(ax, '70 + 80');
plot3(ax, new_xedges_of_connection,new_yedges_of_connection,new_zedges_of_connection,'b')
hold(ax, 'off')

Plus de réponses (0)

Catégories

En savoir plus sur Voronoi Diagram dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by