Merging two figures

988 views (last 30 days)
Mateusz
Mateusz on 24 Mar 2011
Commented: David Hasin on 27 May 2020
I have two figures with different plots. I would like to merge them into one figure that contains both plots and with keeping the title of the figure and axis-labels (both figures have the same title and axis-labels). How can I do this in Matlab? I should also add that I am not interested in "do-by-hand" solution.

Accepted Answer

Matt Fig
Matt Fig on 24 Mar 2011
As an example,
figure(50)
plot(0:.01:1)
figure(60)
plot((0:.01:1).^2)
Now, do this:
L = findobj(50,'type','line');
copyobj(L,findobj(60,'type','axes'));
If you have different figure numbers, put them in place of the 50 and 60.
  6 Comments
David Hasin
David Hasin on 27 May 2020
Woked great, thanks!

Sign in to comment.

More Answers (3)

Ali Benmabrouk
Ali Benmabrouk on 21 Jan 2015
Hello Friends, I have to merge two matlab figures (please take a look on the images below) in one figure in order to compare contours. How can do that??? Thank you so much.

Chunguo Wu
Chunguo Wu on 23 Jan 2016
I'm also caring about this issue.

Community Treasure Hunt

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

Start Hunting!