This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Create figure window


h = figure(...)


For a list of properties, see Figure Properties.


figure creates a new figure window using default property values. This new figure window becomes the current figure, and it displays on top of all other figures on the screen. The title of the figure is an integer value that is not already used by an existing figure. MATLAB® saves this integer value in the figure's Number property.

figure('PropertyName',propertyvalue,...) creates a new figure window using specific property values. For a list of available properties, see Figure Properties. MATLAB uses default values for any properties that you do not explicitly define as arguments.

figure(h) does one of the following:

  • If h is the handle or the Number property value of an existing figure, then figure(h) makes that existing figure the current figure, makes it visible, and moves it on top of all other figures on the screen. The current figure is the target for graphics output.

  • If h is not the handle and is not the Number property value of an existing figure, but is an integer, then figure(h) creates a figure object and assigns its Number property the value h.

  • If h is not the handle to a figure and is not a positive integer, then MATLAB returns an error.

h = figure(...) returns the handle to the figure object.


Specifying Figure Size and Screen Location

To create a figure window that is one quarter the size of your screen and is positioned in the upper left corner, use the root object's ScreenSize property to determine the size. The ScreenSize property value is a four-element vector: [left bottom width height].

scrsz = get(groot,'ScreenSize');
figure('Position',[1 scrsz(4)/2 scrsz(3)/2 scrsz(4)/2])

To position the full figure window including the menu bar, title bar, tool bars, and outer edges, use the OuterPosition property in the same manner.

Specifying the Figure Window Title

You can add your own title to a figure by setting the Name property and turning off the NumberTitle property:

figure('Name','Simulation Plot Window','NumberTitle','off')

Setting Default Properties

You can set default figure properties only on the groot level.


where Property is the name of the figure property and PropertyValue is the value you are specifying. Use set and get to access figure properties.

More About

collapse all


Use dot notation to query or modify a particular figure's property. For example, f.Units = 'inches' sets the Units property of figure f to inches.

Figures can be docked in the desktop. The DockControls property determines whether you can dock the figure.

Making a Figure Current

The current figure is the target for graphics output. There are two ways to make a figure h the current figure.

  • Make the figure h current, visible, and displayed on top of other figures:

  • Make the figure h current, but do not change its visibility or stacking with respect to other figures:


Introduced before R2006a

Was this topic helpful?