This is machine translation

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

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

iptwindowalign

Align figure windows

Syntax

iptwindowalign(fixed_fig,fixed_edge, moving_fig,moving_edge)

Description

example

iptwindowalign(fixed_fig,fixed_edge, moving_fig,moving_edge) aligns the edge moving_edge of figure moving_fig with the edge fixed_edge of figure fixed_fig.

You can align two figure windows along the top, bottom, left, or right edges. You can also center the figures horizontally or vertically. The figure shows the possible alignments.

Examples

Align Two Figure Windows

To illustrate some possible figure window alignments, first create two figures: fig1 and fig2. Initially, fig2 overlays fig1 on the screen.

fig1 = figure;
fig2 = figure;

Use iptwindowalign to move fig2 so its left edge is aligned with the right edge of fig1.

iptwindowalign(fig1,'right',fig2,'left');

Now move fig2 so its top edge is aligned with the bottom edge of fig1.

iptwindowalign(fig1,'bottom',fig2,'top');

Now move fig2 so the two figures are centered horizontally.

iptwindowalign(fig1,'hcenter',fig2,'hcenter');

Input Arguments

collapse all

Fixed figure window, specified as a handle to a figure.

Alignment of the fixed figure window, specified as 'left', 'right', 'hcenter', 'top', 'bottom', or 'vcenter'. To center the figures horizontally, use 'hcenter'. To center the figures vertically, use 'vcenter'.

Moving figure window, specified as a handle to a figure.

Alignment of the moving figure window, specified as 'left', 'right', 'hcenter', 'top', 'bottom', or 'vcenter'. To center the figures vertically, use 'vcenter'.

Tips

  • The two specified edges must be consistent in terms of their direction. For example, you cannot specify 'left' for fixed_edge and 'bottom' for moving_edge.

  • iptwindowalign constrains the position adjustment of moving_fig to keep the figure entirely visible on the screen.

  • iptwindowalign has no effect if either figure window is docked.

See Also

Introduced before R2006a