NAME
plot_series - create unit to plot a time series
PROTOTYPE
unitptr plot_series( int n, char *windesc, char *fmt, float fTimeSpan, float fDt, float ymi, float yma, unittype *dest)
ARGUMENTS
- int n
- nr of graphs to plot simultaneously
- char *windesc
- window descriptor "title xll yll dx dy"
- char *fmt
- plot format (see below)
- float fTimeSpan
- length of time window used for plot
- float fDt
- time difference between consecutive inputs. (used for labeling of t-axis)
- float ymi
- min. y-value
- float yma
- max y-value
- unittype *dest
- 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) input value for first graph
- ...
- ...
- in_n-1[0]:
- (input field 0) input values of n-th graph
- CTL_in[1]:
- (control field) a value of 0 switches the unit off.
DESCRIPTION:
Displays the time course of the n values in_i[0], i=0..n-1 in the
time window [-fTimeSpan,0] of length fTimeSpan into the past.
For each value, a different plot color and plot symbol may be chosen,
using the format string fmt (Each token in fmt
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 plot_xy - unit).
EXECUTION OF CREATED UNIT:
Each exec_call shifts the contents
of the displayed time window Dt into the past and uses the values at
input fields in_0..n-1 to continue the shifted graphs by Dt
into the present time t=0.
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.
All values are plotted in a common range [ymi,yma].
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
STATUS:
beta
SEE ALSO:
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