NAME
plot_vec - create unit to plot a vector
PROTOTYPE
unitptr plot_vec( int n, char *tWdw, char *tFmt, float fMin, float fMax, unitptr uHost)
ARGUMENTS
- int n
- vector dimension (0 for dynamic)
- char *tWdw
- window descriptor (title, xll, yll, width, height)
- char *tFmt
- format string
- float fMin
- lower limit of range
- float fMax
- upper limit of range
- unitptr uHost
- host unit
RETURN VALUE:
A pointer to the created unit or NULL in the case of an error.
INTERFACE OF CREATED UNIT:
- in_0[n]:
- (input field 0) first vector to plot
- ...
- ...
- in_k[n]:
- (input field k) k+1 - vector to plot
- CTL_in[1]:
- (control field) a value of 0 switches the unit off.
EXECUTION OF CREATED UNIT:
Plots values of a number of n - dimensional vectors. The number
k+1 of plotted vectors equals the number of format tokens in
the format string tFmt. For n=0, the vectors may have dynamic
length (in this case, the longest vector determines the plot
range).
The i-th format token of tFmt specifies how the elements of the
i -th vector ( i=0,1,2,..., values at input field in_[i])
are plotted. It must be of the form %c:m:sM, where
c = color, m = marker symbol, s = size (for allowable values
of these parameters, see the description of the xyplot - unit).
All values are plotted in a common range [fMin,fMax].
FURTHER OPTIONS:
- %f:gC
- redefine foreground to color f, background to color g,
(here, 0 and 1 always have the meanings of black and white)
- %fC
- redefine foreground to color f. %0C additionally chooses
white background, i.e., yields black on white.
- %C
- redefine background (foreground) color to NST window (text) color
- %x:y:c=ThisIsText
- add label at relative position (x,y)
(range is 0..1000 along each window side).
ThisIsText must be a single token, but the tilde char
can be used to represent a space.
If :c is omitted, the default will be to use the
center of the label as hot spot.
- %x:y:clThisIsText
- similar to previous option:
add a label ThisIsText at position (x,y).
ThisIsText must be a single token, but the tilde char
can be used to represent a space.
If x>=0, it is horizontal offset to left margin in pixels,
if x<0, -x is considered as a relative horizontal position
with 0=entire left, 1000=entire right.
y is interpreted analogously. The value of c determines
the location of a `hot spot'' relatively to the text:
7 6 5
0ThisIsText4 8 = hot spot at center
1 2 3
Note: to add text at locations given in data coordinates,
use the .draw\_str unit.
- %a:b:c:dt tick marks:
- at least .a and .b labelled tick marks
for the x and y axis, respectively, and a total number
of at least c and d finer subdivisions.
CONTROL MODES:
- NST_PLOT_YLOG:
- switch to logarithmic y-axis scaling
- NST_PLOT_YLIN:
- switch to linear y-axis scaling
- NST_PLOT_BOX:
- draw four-sided axes
- NST_PLOT_NOBOX:
- draw two intersecting axes
EXAMPLES:
SEE ALSO:
plot_series plot_xy, plot_vec, draw_sym,
draw_str, draw_pix, draw_mesh, mouse_xy, view3d
FILE
/local/homes/rhaschke/nst7/man/../o.linx86//../nstsrc/nst_plot.c