Code covered by the BSD License  

Highlights from
figs2subplots

3.75

3.8 | 8 ratings Rate this file 30 Downloads (last 30 days) File Size: 2.34 KB File ID: #6459

figs2subplots

by Francois Bouffard

 

02 Dec 2004 (Updated 15 Feb 2008)

Combine axes in many figures into subplots in one figure.

| Watch this File

File Information
Description

This function allows the user to select figures and axes within figures and copy them as subplots into a new figure.

A list of handles is the only mandatory argument. If a handle to an axes object is found, the corresponding axes are copied to the new figure; if a handle to a figure object is found, figs2subplots automatically finds its children axes and copy them to the new figure.

Optional arguments allows specifying the subplot arrangement in the new figure.

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (10)
11 Mar 2005 Kent Conover

Worked the first time! (in release 14) Just what I wanted.

01 Jul 2005 Nick Koch

Works great! Only bug is that the figure legends in a figure is copied over as a separate subplot, despite the intended design of the function. A work around is to go back and assign the legends after this command is used.

25 Jul 2005 Ben Michell

Would get a higher rating if the legend bug was fixed. Otherwise useful.

26 Jul 2005 François Bouffard

I submitted a quick workaround for the legend problem on 2005-07-26: the legends are simply ignored now. Legends still have to be rebuilt in the new figure though: copying legend objects is not straightforward. At least the function is more useable now.

01 Mar 2006 Sergei K

Does not work for in Matlab r14(SP3). Persist on putting all figures into first subplot window, regardless of handle, optional arguments etc..
2) Help section is absolutely unclear what to do with input arguments. Few practical examples could be very helpful there
.

24 Jan 2007 B A

Seems to work fine on Ver7.3.0.267 for figures with one plot. But, does not handle figures that already have subplots in them.

03 Aug 2007 Janus Wesenberg

Works like a charm (Matlab v7.3) -- and just what I was looking for.

05 Oct 2007 Wang Win

Just what i am looking for, many thanks!!!

18 May 2008 Shalin Mehta

Threw up this error when there was no legend present in any of the axes:

??? Undefined function or variable "hLegParAxes".

Error in ==> figs2subplots at 96
    [ii jj] = ismember(av(k),hLegParAxes);

Easily fixed by initialization:
@Line 67: hLegParAxes=NaN;

Otherwise, very useful piece of code.
Thanks!

11 Jun 2008 gn gn

Excellent feature, but a little hard to understand in handling figures with subplots in it...

Please login to add a comment or rating.
Updates
26 Jul 2005

A quick workaround for the legend problem: legends are no longer copied to the new figure. However, legends do not appear on the new figure at all.

01 Aug 2006

More tiling arrangement options; help section updated.

15 Feb 2008

Now supports legends thanks to code from Zoran Pasaric

Tag Activity for this File
Tag Applied By Date/Time
annotation Francois Bouffard 22 Oct 2008 07:37:12
customization Francois Bouffard 22 Oct 2008 07:37:12
suplot Francois Bouffard 22 Oct 2008 07:37:12
figure Francois Bouffard 22 Oct 2008 07:37:12
copy Francois Bouffard 22 Oct 2008 07:37:12
axes Francois Bouffard 22 Oct 2008 07:37:12
graphics Francois Bouffard 22 Oct 2008 07:37:12

Contact us at files@mathworks.com