File Exchange

image thumbnail

Split/Merge Matlab figures.

version 1.0 (4.07 KB) by

Split/Merge Matlab figures.

4.33333
10 Ratings

6 Downloads

Updated

View License

Split/Merge Matlab figure using a reference to the figures.
It can be given as a list of paths to one or more *.fig file, or as a list of opened figure handles.

Splitting figure takes a copy of each axes from a figure (or a list of figures) into new ones (one axes per figure).
Merging figures takes a copy of each axes into several axes, all in a new figure.

Comments and Ratings (12)

chen kuang

Great function! Thank you very much!
The output SubHdl should be replaced by C(k) if the axes of subplots are needed, since SubHdl has been deleted at line 160.
Thus the code from 161 to 162 should be modified as follows:
C(k) = copyobj(OldGca, FigHdl);
set(C(k), 'Position', NewPos);

Paul Bruner

Julia

Julia (view profile)

Jcq

Jcq (view profile)

Works great.

That said, though, I don't really understand some of the inputs. ¿ SubsLoc? ¿ Is the "true" in examples related to the order?

Great to merge several figures in one. I used it to clone an existing figure , paste it into a subplot, and force diferent azimuth/elevation cameras.

Matthijs

Very useful. The only problem I had is that it messes up the figure if the original axes units were not normalized. This can be fixed by inserting

set(C,'Units','normalized');

before

set(C, 'Position', NewPos);

Addison Rich

Also exactly what I was looking for. If you want it display the legend as well, just insert this at line 162 (assuming your previous figures had a legend):

legend(C,'show');

Jesús Lucio

Perfect. Exactly what it says. It will leave me from some headaches...

Jesús Lucio

Does not return handles of subplot in SubHdl as these are deleted in line 160.
Handles should be of new object created as:

SubHdl(k) = copyobj(OldGca, FigHdl);
set(SubHdl(k), 'Position', NewPos);

Also it does not produce legends, otherwise it is useful.

sdfsdfsdf

Alexander

Exactly, what I was looking for. The function compensates for essential but missing functionality in Matlab.
Thanks!

MATLAB Release
MATLAB 7.10 (R2010a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today