FunctionDraws a Cartesian coordinate system and plots a Y-vector against an X-vector into it.
Syntax C/C++#include <Vgraph.h>
void VF_xyAutoPlot( fVector X, fVector Y, ui size, unsigned form, COLORREF color );
C++ VecObj#include <OptiVec.h>
void vector<T>::xyAutoPlot( const vector<T>& X, unsigned form, COLORREF color );
Pascal/Delphiuses Vgraph;
procedure VF_xyAutoPlot( X, Y:fVector; size:UIntSize; form:UInt; color:COLORREF );
DescriptionA Cartesian coordinate system is drawn with automatic scaling of the axes and the vector Y is plotted against the vector X. Prior to calling VF_xyAutoPlot, the plotting routines have to be initialized by V_initPlot.
The VecObj version of this function has to be called as a member function of Y (rather than of X).
The font of the axis tick labels is the text font of the current device context.

The style of the plot is determined by the parameter form which should be constructed using the symbolic constants defined in <Vgraph.h> (C/C++) or in the unit Vgraph (Pascal/Delphi).
For the line styles, Borland's old BGI notation is still supported along with the standard Windows notation; the necessary macros for the translation are included in <Vgraph.h> and in the unit Vgraph.

1. Style of lines connecting adjacent data points:
Windows styleBGI C/C++BGI Pascalappearance
PS_SOLIDSOLID_LINESolidLn–––– (default)
PS_DASHDOTDOT  - · · - · ·
PS_NULLNULL_LINENullLn(no line at all)

2. Symbols used to mark data points:
SY_NULL(no symbol at all)   (default)

3. Fill-style of the symbols:
SY_HOLLOWno filling  (default)
SY_DOTTEDhollow, with a dot at the exact position of the data point

The parameter form has to be constructed by adding the appropriate line style, the symbol and its fill-style, e.g. (SOLID_LINE + SY_TRIANGLEUP). Alternatively, the bit-wise "OR" operation may be used, e.g. (PS_SOLID | SY_CIRCLE | SY_DOTTED ).
In Pascal terms, these examples read:

Note that NULL_LINE or PS_NULL has to be explicitly specified, if the data points are not to be connected by lines. Just writing, e.g. (SY_BOX | SY_HOLLOW) would be interpreted as using the default line style, which is SOLID_LINE.

SY_NULL and SY_HOLLOW need not be specified, since these are the default symbol and fill-style, resp. For SY_NULL, SY_CROSS, SY_PLUS, and SY_STAR, the choice of fill-style has no effect.

The parameter color denotes the colour that is to be used for the plot (the data type COLORREF is unsigned long / ULong). The "standard" colors BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, BROWN, LIGHTGRAY, DARKGRAY, LIGHTBLUE, LIGHTGREEN, LIGHTCYAN, LIGHTRED, LIGHTMAGENTA, YELLOW, and WHITE are defined in <Vgraph.h> (or the unit Vgraph) by analogy with the COLORS defined for the old BGI. Nevertheless, it is recommended to use fine-tuned colors defined by the RGB macro, instead of the predefined colors.

The size of the symbols may be modified with the function V_setSymbolSize. The thickness of the lines may be modified using V_setLineThickness.
For examples, see the demo programs VDEMO and FITDEMO.

Error handlingnone
Return valuenone
See alsoVF_xyDataPlot,   VF_yAutoPlot,   VCF_autoPlot,   V_drawAxes,   V_findAxes,   V_setSymbolSize,  chapter 4.12

VectorLib Table of Contents  OptiVec home