Standard Library procedure that draws a two-dimensional velocity fieldplot, with each directed arrow indicating the magnitude and direction of the field.
v
x
y
Length
Missing
If the magnitude of the vector at (i, j) is less than the corresponding value in Missing, then the data is considered to be valid. Otherwise, the data is considered to be missing.
Thus, one way to set up a Missing array is to initialize all elements to some large value:
missing_array = FLTARR(n, m) + 1.0E30
missing_array(i, j) = -missing_array(i, j)
If missing values are present, you can use the Missing keyword to specify that they be ignored during the plotting, or the Dots keyword to specify that they be marked with a dot.
The system variables ![XY].Title and !P.Title may be used to title the axes and the main plot.
u = FLTARR(21, 21) v = FLTARR(21, 21)
.RUN
FOR j = 0, 20 DO BEGIN
FOR i = 0, 20 DO BEGIN
x = 0.05 * FLOAT(i)
z = 0.05 * FLOAT(j)
u(i, j) = -SIN(!Pi*x) * COS(!Pi*z)
v(i, j) = COS(!Pi*x) * SIN(!Pi*z)
ENDFOR
ENDFOR
END
VELOVECT, u, v
Figure 2-135 Velocity field displayed using default values.
Figure 2-136 Velocity field displayed using default values.
VELOVECT, u, v, Length=2
Figure 2-137 Velocity field displayed using arrows twice the length of a single cell.
Figure 2-138 Velocity field displayed using arrows twice the length of a single cell.
missing = FLTARR(21, 21) + 1.e30 missing(4:6, 7:9) = -1.e30 missing(15:17, 16:19) = -1.e30 VELOVECT, u, v, Missing=missing, /Dots
Figure 2-139 Velocity field that contains missing data.
Figure 2-140 Velocity field that contains missing data.