Code covered by the BSD License  

Highlights from
SUBFIGURE

5.0

5.0 | 1 rating Rate this file 12 Downloads (last 30 days) File Size: 13.32 KB File ID: #23135
image thumbnail

SUBFIGURE

by Matt Fig

 

26 Feb 2009

SUBFIGURE creates figures in tiled positions.

| Watch this File

File Information
Description

SUBFIGURE creates figures in tiled positions.
H = SUBFIGURE(a,b,c) breaks the computer screen into an a-by-b matrix of
small figures, selects the c-th figure for the current figure, and
returns its handle. The figures are counted along the top row of the
computer screen, then the second row, etc. This is the same way that
SUBPLOT tiles axes in a figure. H is not returned if not requested.
More than one figure can be created by calling SUBFIGURE with a cell of
positions, or by specifying 'all' in the position argument. If 'all' is
called, this will be treated as if a cell {1:a*b} had been passed. If
more than one figure is created at a time, SUBFIGURE will create an axes
object in each figure and H will have two columns. Each row of H will
contain the figure handle and corresponding axes handle.
SUBFIGURE has a 37 pixel offset from the bottom of the screen built-in.
Since this is the first line of code, it is easily changed by the user
for their particular system if needed or desired.

SUBFIGURE(a,b,'all') or SUBFIGURE(a,b,{1:a*b}) plots a*b figures
     on screen in a a-by-b pattern.
SUBFIGURE(a,b,C), where C is a vector, specifies a single figure position
     that covers all the subfigure positions in C.
SUBFIGURE(N,N,{1:N:N^2}) plots N figures on the left side of the screen.
SUBFIGURE(N,N,1:N:N^2) plots one figure that covers the figures from the
     previous example, in the left Nth of the screen.
SUBFIGURE(N,N,{1:N}) plots N figures on the top of the screen.
SUBFIGURE(N,N,1:N) plots one figure on the top Nth of the screen.
SUBFIGURE(a,b,c,'replace') if a figure exists at position c, replaces it.
SUBFIGURE(...,PROP1, VALUE1, PROP2, VALUE2, ...) sets the specified
property-value pairs for the figure(s).
SUBFIGURE(5,5,{1:5:25},'menubar','none') plots 5 figures with no menubars
on the left hand side of the screen, this can be useful when plotting
subfigures because the menubars can take up a lot of space (relatively).

The screenshot was made with the following:
x = -9*pi:.001:9*pi;
y = sin(x)./x;
subfigure(3,2,[1 2],'menubar','none')
plot(x,y)
y2 = cos(x)./x;
subfigure(3,2,[5 6],'menubar','none')
plot(x,y2),ylim([-1 1])
subfigure(3,4,[6 7],'menubar','none')
plot(x,1./y),ylim([-200 200])
[x,y,z] = peaks(40);
H = subfigure(3,4,{5 8},'menubar','none');
mesh(H(3),x,y,z)
surf(H(4),x,y,z)
Also included is the test harness written to test SUBFIGURE for errors. It is included mainly because it can serve as a demo.
Additionally, there is a version of SUBFIGURE which will run on Matlab 6.5 This is included as a convenience.

Tested on 2006a, 2007a,b Ver 6.5
Please email me about any bugs found.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
tilefigs.m
This submission has inspired the following:
subfigure

MATLAB release MATLAB 7.4 (R2007a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
30 Nov 2011 Reza Farrahi Moghaddam  
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
subfigure Matt Fig 27 Feb 2009 10:23:24
figure Matt Fig 27 Feb 2009 10:23:24
plot Matt Fig 27 Feb 2009 10:23:24
tile Matt Fig 27 Feb 2009 10:23:24
subplot Matt Fig 27 Feb 2009 10:23:24
graphics Matt Fig 27 Feb 2009 10:23:24

Contact us at files@mathworks.com