Before you do anything, save each of your four figures as a MATLAB figure so your figures aren't lost!
Once you do that, close them all and run this example. The example makes four figures then pauses for you to look at them. When you are ready, press return at the command line to copy them all to a single figure. Once you understand the example, build your own to work with your figures. You will have to open your figures again, then run the relevant part of the code.
figure
plot(1:10)
figure
plot((1:10).^2)
figure
plot((1:10).^3)
figure
plot((1:10).^4)
pause
fh = figure;
for ii = 1:4
subplot(2,2,ii)
P{ii} = get(gca,'pos');
end
clf
F = findobj('type','figure');
for ii = 2:5
ax = findobj(F(ii),'type','axes');
set(ax,'parent',fh,'pos',P{6-ii})
close(F(ii))
end
Best Answer