SETVPORT

Purpose:

Sets the coordinate viewport of a target current Window to the source Window.

Syntax:

SETVPORT(srcwin, targwin)

srcwin

-

A Window. The template Window.

targwin

-

Optional. A Window, the target Window to modify. Defaults to the current Window.

Returns:

Nothing.

Examples:

W1: gnorm(1000,.01);setx(.2, .5)

W2: W1*W1;setvport(w1);

 

The squared data in W2 is displayed with the same X and Y coordinates as W1.

Example:

setvport(w1, w2)

 

Same as above, but the destination window, W2, is explicit.

Example:

W3: gnorm(100,1);onplot(eval("setvport(w3, w4)"))

W4: gsin(100,1,.02)

 

The viewport of W4 is linked to the viewport of W3. W4 will scroll, expand or compress whenever W3 scrolls, expands or compresses (ONPLOT). The ONPLOT function uses EVAL to prevent W3 from referring to itself and to prevent W3 from being dependent on W4.

Example:

W3: gnorm(100,1);onplot(setvport(w0, w4))

W4: gsin(100,1,.02)

 

Similar to above where the viewport of W4 is linked to the viewport of W3. W4 will scroll, expand or compress whenever W3 scrolls, expands or compresses. However in this case, W3 is dependent on W4, so when the data in W4 changes, W3 automatically updates.

Remarks:

SETVPORT also works properly on arrays and images and is very useful when visually comparing data.

See Also:

CUT

EVAL

ONPLOT

W0