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

11 visualizaciones (últimos 30 días)
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 ?

Respuesta aceptada

Paul
Paul el 7 de Abr. de 2024
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);

Más respuestas (0)

Etiquetas

Productos


Versión

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by