The PLOT_FIELD procedure plots a 2-D field. N random points are picked, and from each point a path is traced along the field. The length of the path is proportional to the field vector magnitude.

This routine is written in the IDL language. Its source code can be found in the file plot_field.pro in the lib subdirectory of the IDL distribution.

Examples


; Create array X:
X = FINDGEN(20, 20)
; Create array Y:
Y = FINDGEN(20, 20)*3
; Plot X vs. Y:
PLOT_FIELD, X, Y

The above commands produce the following plot:

Syntax


PLOT_FIELD, U, V [, ASPECT=ratio] [, LENGTH=value] [, N=num_arrows] [, TITLE=string]

Arguments


U

A 2-D array giving the field vector at each point in the U(X) direction.

V

A 2-D array giving the field vector at each point in the V(Y) direction.

Keywords


ASPECT

Set this keyword to the aspect ratio of the plot (i.e., the ratio of the X size to Y size). The default is 1.0.

LENGTH

Set this keyword to the length of the longest field vector expressed as a fraction of the plotting area. The default is 0.1.

N

Set this keyword to the number of arrows to draw. The default is 200.

TITLE

Set this keyword to the title of plot. The default is “Velocity Field”.

Version History


Original

Introduced

See Also


FLOW3, VEL Procedure, VELOVECT Procedure