How to convert Matlab figures into subplots without having to redraw the plots again in the command window?

13 ビュー (過去 30 日間)
hello
I have a number of Matlab figures that I want to convert to subplots without having to redraw the figures in the command window . I know there is a function called subplot and tilelayout, is there a way that a Matlab figure can be converted by copying the axis of each figure into the respective tile within the tiled layout ?

採用された回答

Paul
Paul 2024 年 4 月 7 日
Use copyobj to copy the axes of interest to a new figure, then arrange with subplot
figure
plot(rand(3))
ax0 = gca;
hnew = figure;
ax1 = copyobj(ax0,hnew);
subplot(3,1,1,ax1)
% show that we can copy another axes into the same figure.
ax3 = copyobj(ax0,hnew);
subplot(3,1,3,ax3);

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by