5.0

5.0 | 1 rating Rate this file 68 downloads (last 30 days) File Size: 2.47 KB File ID: #23426

subfigure

by Steve Hoelzer

 

25 Mar 2009

Code covered by BSD License  

Create a figure within a grid-based layout. Like subplot, but for figures.

Download Now | Watch this File

File Information
Description

subfigure(m,n,p), or subfigure(mnp), divides the screen into an m-by-n grid of tiles and creates a figure within the pth tile. Tiles are counted along the top row of the screen, then the second row, etc.

If p is a vector, the figure is sized to cover all the subfigure positions listed in p.

subfigure(m,n) creates a figure showing a m-by-n grid layout with tiles labeled in the order that they are numbered by subfigure. This is useful for planning screen layouts, especially when one or more subfigures will span multiple tiles (when p is a vector).

h = subfigure(...) returns a handle to the figure.

Every call to subfigure creates a new figure even if a figure exists at the location specified by m, n, and p. The existing figure is not made current or reused. Existing figures that are overlapped by new subfigures are not deleted. This behavior is dissimilar to subplot.

Example 1: Four non-overlapping figures.

    subfigure(2,2,1)
    subfigure(2,2,2)
    subfigure(2,2,3)
    subfigure(2,2,4)

Example 2: Three non-overlapping figures of various sizes.

    subfigure(4,4,[1 13])
    subfigure(4,4,[2 4])
    subfigure(4,4,[6 16])

Example 3: Show the grid for a 3 x 5 layout.

    subfigure(3,5)

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
SUBFIGURE

MATLAB release MATLAB 7.6 (R2008a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
07 Apr 2009 Alan Brooks

Very useful tool for grouping plots. I've used it often.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
gui tools Steve Hoelzer 25 Mar 2009 16:18:14
graphics Steve Hoelzer 25 Mar 2009 16:18:14
figure Steve Hoelzer 25 Mar 2009 16:18:14
subfigure Steve Hoelzer 25 Mar 2009 16:18:14
grid Steve Hoelzer 25 Mar 2009 16:18:14
subplot Steve Hoelzer 25 Mar 2009 16:18:14
tile Steve Hoelzer 25 Mar 2009 16:18:14
plot Steve Hoelzer 25 Mar 2009 16:18:14
subplot Mohammad Nizam 26 May 2009 03:15:17
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com