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 个)

标签

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by