Merge 3 .FIG figures into one graph

3 views (last 30 days)
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

Cris LaPierre
Cris LaPierre on 3 Nov 2022
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
Cris LaPierre on 3 Nov 2022
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

Community Treasure Hunt

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

Start Hunting!

Translated by