figure
h = figure
figure(h)
h = figure('PropertyName',PropertyValue,...)
figure
, by itself, opens a new figure (graph window).
h = figure
opens a new figure and returns the next available figure number, also known as the figure handle. Figure handles are integers numbered sequentially starting at 1 and are displayed in the border at the top of the window.
figure(h)
makes the figure with handle h
the current figure for subsequent plotting commands.
h = figure('PropertyName',PropertyValue,...)
accepts property name/property value pairs as input arguments. These properties are described under "Object Properties." You can also set and query property values after creating the object using the set
and get
functions.
Use gcf
(get current figure) to obtain the handle of the current figure. The current figure is the window in which any drawing command is directed.
Specify default figure properties at the figure's parent level, that is, at the root object. To do so, call the set
function, supplying as arguments the handle 0 (for the root), a default name string, and the desired default value. Construct the default name string by prepending the string 'DefaultFigure'
to the desired figure property name. For example
set(0,'DefaultFigureColor','blue')
sets the default figure background color to blue.
BackingStore
on
(Default.) Store copy of figure. When obscured parts of the figure are uncovered, the system restores them without rerendering. This causes faster screen redraws, but uses more memory.off
Redraw previously obscured portions of the figure.ButtonDownFcn
eval
function to execute the specified function. Initially the empty matrix.Children
Clipping
on
(Default.) No effect for figure objects.off
No effect for figure objects.Color
Color
is black. See the
ColorSpec reference page for more information on specifying color. ColorMap
m
-by-3 matrix of RGB values. Graphics commands index the colors in the colormap by their row number. For example, an index of 1 specifies the first RGB triplet, an index of 2 specifies the second RGB triplet, and so on. The maximum colormap length is determined by your system (usually slightly less than 256 colors), but the colormap must be three columns wide. The default figure colormap contains 64 predefined colors.hsv
, with your own or with one of MATLAB's predefined colormaps. To define a colormap, specify the intensity of the red component in the first column, the green component in the second column and the blue component in the third column. Color intensities are floating-point numbers in the range [0 1]. A value of 0 indicates no intensity and a value of 1 indicates full intensity. An RGB triplet of [0 0 0] specifies black and [1 1 1] specifies white.colormap
and ColorSpec
reference pages for more information.CurrentAxes
gca
when this figure is the current figure. If axes children exist, there is always a current axes for the figure. If there are no axes in a figure,
get(gcf,'CurrentAxes')
CurrentCharacter
Last key pressed.
CurrentMenu
CurrentObject
CurrentPoint
(see below). This object is the front-most object in the stacking order. Use this property to determine which object you have selected.CurrentPoint
[x y]
containing the x- and y-coordinates of the location in the figure window where you last pressed or released the mouse button. This is measured from the lower-left corner of the figure window in units specified by the Units
property. Initially [0 0].FixedColors
n
-by-3 matrix of RGB values that define the fixed colors for the figure. Fixed colors take up slots in the system color table, reducing the number of slots available for colormaps. Initial fixed colors are white and black.Interruptible
yes
Any of the figure's callbacks are interruptible by other callbacks.no
(Default.) The callbacks are not interruptible.Interruptible
property.InvertHardCopy
on
(Default.) For printed output, change black figure background to white, and lines, text, and so on to black. Surface and patch colors are not affected. If the output device does not support color, lines and text in colors other than black or white are changed to either black or white (whichever provides the most contrast with the paper background).off
Color of printed output exactly matches screen display.KeyPressFcn
eval
function to execute the specified function. Use the CurrentCharacter
property to determine which key was pressed. Use the PointerWindow
property of the root object to determine in which figure the key was pressed. (Note that pressing a keyboard key over a figure does not make that figure active.) Initially the empty matrix.MenuBar
figure
(Default.) Display default MATLAB menus for figure. On some systems, these menus appear at the top of the figure window; on others, they appear at the top of the screen.none
Do not display default MATLAB menus. Some systems still display system-specific menus.MinColorMap
MinColorMap
number of slots. If the resulting number of slots is smaller than the length of the colormap, individual colormap entries are grouped together piecewise with their neighbors to create as many groups as there are available slots in the color table. In this case, all members of a given group display in the color of the group's center member. MinColormap
to the number of distinct colors in the image to avoid displaying it in false colors, even when the figure is active.Name
Figure
No.
1
, Figure
No.
2
, and so on. If you set Name
to string
, the title becomes Figure
No.
n:
string
.NextPlot
new
Create a new figure before drawing.add
(Default.) Add new objects to the current figure.replace
Reset all figure properties except Position
and delete all figure children before drawing.plot
, plot3
, fill
, fill3
, and the M-file graphing functions mesh
, surf
, bar
, and so on. The M-file newplot
is a preamble for handling the NextPlot
property. M-file graphing functions like mesh
, surf
, and bar
call newplot
to control this property before drawing their respective graphs. When creating M-files that implement graphing commands, use newplot
at the beginning of the file. See the M-file pcolor
for an example. Also see the NextPlot
property of axes objects.NumberTitle
on
(Default.) Prepend the string Figure
No.
N
to the figure window title.off
Do not add figure number to the figure window title.PaperOrientation
portrait
(Default.) Portrait orientation - longest dimension of page is verticalland
Landscape orientation - longest dimension of page is horizontal.PaperPosition
[left,bottom,width,height]
, where left
and bottom
are the distance from the lower-left corner of the page to the lower-left corner of the printed figure window. width
and height
are the dimensions of the printed figure window. All measurements are in units specified by the PaperUnits
property. Initial setting depends on PaperSize
and PaperOrientation
.PaperSize
[width,height]
, containing the current PaperSize
measured in PaperUnits
. The default PaperSize
is [8.5 11]
.PaperType
usletter
(Default.) Standard US letter.uslegal
Standard US legal.a4letter
European A4.PaperUnits
property is set to normal, MATLAB uses PaperType
to scale printed figures so they fit on the page correctly.PaperUnits
normal
Normalized coordinates, where the lower-left corner of the page maps to (0,0) and the upper-right corner to (1.0,1.0).inches
(Default.) Inches.cent
Centimeters.points
Points. Each point is equivalent to 1/72 of an inch.PaperPosition
and PaperSize
measurements. If you change the value of PaperUnits
, it is good practice to return it to its default value after completing your computation so as not to affect other functions that assume PaperUnits
is set to the default value.Parent
Pointer
arrow
(Default.) Arrow.crossh
Crosshair.watch
Watch.cross
Double-line cross.topl
Arrow pointing to upper-left corner of figure.topr
Arrow pointing to upper-right corner of figure.botl
Arrow pointing to lower-left corner of figure.botr
Arrow pointing to lower-right corner of figure.circle
Circle. fleur
Four-headed arrow (compass). Position
[left,bottom,width,height]
, where left
and bottom
are the distance from the lower-left corner of the screen to the lower-left corner of the figure window. width
and height
are the dimensions of the figure window. All measurements are in units specified by the Units
property.Resize
on
(Default.) Users can resize the figure window using the mouse. off
Users cannot resize the figure window. SelectionType
normal
(Default.) Click the mouse button (press and release) while the pointer is over the object to select.extended
Hold down the Shift key and make a normal
selection. Add selections by keeping the shift key depressed.extended
selections by clicking both buttons simultaneously. For a three-button mouse, use mouse button 2.alt
Hold down the Control key and make a normal
selection. For a two- or three-button mouse, press the right-most button.open
Double-click the mouse while the pointer is over the object to select. For a two- or three-button mouse, use the same button for both clicks.ShareColors
yes
(Default.) MATLAB minimizes color table use by reusing existing color table slots whenever possible. This allows the maximum number of windows to render their contents accurately.no
Do not share color table slots with other windows.Type
'figure'
for a figure object.Units
pixels
(Default.) Screen pixels.normalized
Normalized coordinates, where the lower-left corner of the figure window maps to (0,0) and the upper-right corner to (1.0,1.0).inches
Inches.cent
Centimeters.points
Points. Each point is equivalent to 1/72 of an inch.Units
, it is good practice to return it to its default value after completing your computation so as not to affect other functions that assume Units
is set to the default value.UserData
get
command.
Visible
on
(Default.) Figure window is visible on the screen.off
Figure window is not visible on the screen.WindowButtonDownFcn
eval
function to execute the specified function. Initially the empty matrix.WindowButtonDownFcn
property.WindowButtonMotionFcn
eval
function to execute the specified function. Initially the empty matrix.WindowButtonMotionFcn
property.WindowButtonUpFcn
eval
function to execute the specified function. If you move the pointer between figures, the callback executed is that associated with the figure where the button was pressed. Initially the empty matrix.WindowButtonUpFcn
property.axes
,clf
,close
,gcf
,subplot
(c) Copyright 1994 by The MathWorks, Inc.