Merge 3 .FIG figures into one graph

I want to combine these 3 .fig figures into a single graph. How can I do this? I have tried in the following way but I do not get the desired result.
fig1 = openfig("fig1.fig");
fig2 = openfig("fig2.fig");
fig3 = openfig("fig3.fig");
L = findobj(fig1,'type','line');
copyobj(L,findobj(fig2,'type','axes'));

 Accepted Answer

Your code works for me (a modified to also add fig3 to fig2), and does what I would expect. If this is not the desired result, please provide more details on why or why not.

2 Comments

@Cris LaPierre Can you write the code you used to represent all 3 .figs?
fig1 = openfig("fig1.fig");
fig2 = openfig("fig2.fig");
fig3 = openfig("fig3.fig");
L = findobj(fig1,'type','line');
copyobj(L,findobj(fig2,'type','axes'));
L2 = findobj(fig3,'type','line');
copyobj(L2,findobj(fig2,'type','axes'));

Sign in to comment.

More Answers (0)

Categories

Find more on Printing and Saving in Help Center and File Exchange

Products

Release

R2021b

Community Treasure Hunt

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

Start Hunting!