Be the first to rate this file! 109 downloads (last 30 days) File Size: 5.46 KB File ID: #24064

figure window generator fig.m, version 3.1

by Phillip M. Feldman

 

10 May 2009 (Updated 18 Jun 2009)

Code covered by BSD License  

open a new figure window having specified size

Download Now | Watch this File

File Information
Description

fig() opens a new figure window of specified size, creates an axes object within the window, and applies any additional figure window properties that are specified. The window size may be given in units of either screen dimensions (i.e., as fractions of the width and height of the screen) or pixels. The calling program may also specify the color of the region inside the axes, the color of the frame around the axes, and any parameters that would be passed to Matlab's figure() function.

Syntax:

   handle= fig(w, h, option1, value1, ... );

All calling arguments are optional. Arguments must be specified in pairs. In particular, one cannot specify w without also specifying h.

- w is the window width specified either as a fraction (0 to 1) of the screen width or in pixels (a whole number greater than or equal to 200). The default width is 0.8.

- h is the window height specified either as a fraction (0 to 1) of the screen height or in pixels (a whole number greater than or equal to 100). The default height is 0.6.

Note: The units of w and h must be the same, i.e., you must not specify one as a fraction of the screen dimension and the other in pixels.

Any arguments following w and h are option/value pairs. The options are always strings. Allowed options and corresponding values are as follows:

- AxesColor specifies the color of the region inside the axes.

- BackgroundColor specifies the color of the frame around the axes.

Each color specification must be an RGB 3-tuple, the name of a color (lower-case string), or a color index (1-21). Default colors are white.

MATLAB release MATLAB 7.8 (R2009a)
Zip File Content  
Other Files fig.m,
license.txt,
lookup.m,
RGB.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
11 May 2009

- Eliminated dependence on getargs().

- Modified code to allow any parameter name/value pairs that would be accepted by Matlab's figure() function.

- Window width and height may now be specified in units of either screen dimensions or pixels.

18 Jun 2009

Version 3.1.1, 6-18-2009:
Fixed code so that parameter name for background color can be either 'BgndColor' or 'BackgroundColor'.

Tag Activity for this File
Tag Applied By Date/Time
figure Phillip M. Feldman 11 May 2009 10:50:14
figure window Phillip M. Feldman 11 May 2009 10:50:14
background and frame color Phillip M. Feldman 11 May 2009 10:50:14
rgb Phillip M. Feldman 11 May 2009 10:50:14
 

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