Example - Specifying Figure Position

Suppose you want to define two figure windows that occupy the upper third of the computer screen (e.g., one for uicontrols and the other to display data). To position the windows precisely, you must consider the window borders when calculating the size and offsets to specify for the Position properties.

The figure Position property does not include the window borders, so this example uses a width of 5 pixels on the sides and bottom and 30 pixels on the top.

Ensure root units are pixels and get the size of the screen

Define the size and location of the figures

Create the figures

The two figures now occupy the top third of the screen.

  Positioning Figures Controlling How MATLAB Uses Color