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

5 ビュー (過去 30 日間)
Loren99
Loren99 2022 年 9 月 6 日
編集済み: Loren99 2022 年 9 月 8 日
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

採用された回答

Walter Roberson
Walter Roberson 2022 年 9 月 6 日
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')

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeVoronoi Diagram についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by