Mischa Kim on 23 Jul 2014
⋮
Edited: Mischa Kim on 23 Jul 2014
Jimmy, as a very efficient approach (if you only need to do it once) I recommend a simple copy-paste:
- Open both figures
- Select "Show Plot Tools and Dock Figure" in both figures (see figure below)
- Select one of the plot lines and copy [CTRL+C]
- Paste [CTRL+V] in the other plot
- Change the line properties to your liking
Of course, you could use the programmatic approach, e.g., say you have to figures, one line plot each:
fh1 = open('f1.fig');
fh2 = open('f2.fig');
ax1 = get(fh1, 'Children');
ax2 = get(fh2, 'Children');
ax2p = get(ax2(1),'Children');
copyobj(ax2p, ax1(1));
For n figures you would simply use a for-loop to copy all objects.
8 Comments Show 6 older commentsHide 6 older comments
Show 6 older commentsHide 6 older comments
Vaultec on 23 Jul 2014
⋮
how would i go about setting them to separate markers automatically?, sorry a bit new to matlab so I'm not quite sure how to do that and write a for loop
Joel Fernandez on 7 Apr 2020
⋮
thank you! it works for 2 .fig files
could you please show us how it should be for 3 .fig files? ... then I will do the for-loop for n figures by myself (promise)
Pritesh gamit on 10 Mar 2021
⋮
Thank you sir. It helped me a lot. now i can see both figure in only one window.