vecfld | set a vector field to the graphics |
<graphic> | name of the graphic structure |
-n <name> | name of the point matrix |
-d <data> | data to be displayed |
[-fw <field>] | the field holds width of the vectors |
[-fb <field>] | field of the start points |
[-fe <field>] | field of the end points |
[-co <color>] | color of the vectors |
vecfld <graphic> -n <name> -rm | Remove a vector field |
The command sets a vector field to the graphics. The vectors can be defined through their coordinates, width, sizes of the starting and ending points and their color. The coordinates are given in a mandatory parameter <data>. It must have six fields: three first fields are coordinates of the starting points, and three last fields holds coordinates of the ending points. The scales of the values is the unit cubic . Note that vector fields does not depend on axis settings.
The optional parameters with the flags -fb and -fe describe sizes of the start and end points. Their scales are also in the range [0,1], indicating that the point with the value 1 fills the unit cubic. Therefore, typical values for these parameters are about 0.01.
The vector width is given in the field with the flag -fw. The width is a relative value where the value 0 means the minimum width, and the scale depends on the implementation of the graphic display. Note that the graphic display does not necessarily support this feature.
Example (ex7.36): The following commands generate random data and displays it as a vector field. The figure below shows two displays: in the first (PostScript) the width of the links is constant, while in the second one the display can change the width (Xview).
# Create a random data # NDA> setdata -f i -vals 0=0; -t float -len 25 NDA> expr -fout vdat.x1 -expr 'i' - 'i' + RAND(1.0); NDA> expr -fout vdat.y1 -expr 'i' - 'i' + RAND(1.0); NDA> expr -fout vdat.z1 -expr 'i' - 'i'; NDA> expr -fout vdat.x2 -expr 'vdat.x1' + RAND(0.4) + -0.2; NDA> expr -fout vdat.y2 -expr 'vdat.y1' + RAND(0.4) + -0.2; NDA> expr -fout vdat.z2 -expr 'i' - 'i'; NDA> serie -d vdat -fout x -start 1 -step 0 NDA> expr -fout p -expr 'i' - 'i' + RAND(1.0) / 25.0; NDA> expr -fout q -expr 'i' - 'i' + RAND(10.0); # # Create graphics and set the axis scales # NDA> mkgrp win1 # NDA> axis win1 -ax x -sca abs -min 0.0 -max 1.0 -step 3 NDA> axis win1 -ax y -sca abs -min 0.0 -max 1.0 -step 3 # # Set the vector field # NDA> vecfld win1 -n v -d vdat -co red -fe p -fw q # # Enable the vector field in the low level graphics # NDA> en win1 vecfld axis NDA> viewp win1 -dz 150