Navigation:  DPLOTLIB Functions >

DPlot_AddData function

Print this Topic Previous pageReturn to chapter overviewNext page

int DPlot_AddData(int DocNum, int DataType, int NumPts, int Curve, float *array1, float *array2);

int DPlot_AddData8(int DocNum, int DataType, int NumPts, int Curve, double *array1, double *array2);

 

Parameters

DocNum

Document index for the document that you want to add data to. In general this value will have been returned by a previous call to DPlot_Plot or DPlot_Command with a FileNew command.

DataType

Must be DATA_XYXY (XY plot), DATA_3DR (contour plot of randomly-spaced 3D points), DATA_3DS (3D scatter plot), or DATA_1D (box-and-whisker plots and dot graphs). These constants are defined in the header files for the various demo programs.

NumPts

Number of data points to add.

Curve

1-based index of the curve (for DATA_XYXY), group (for DATA_1D), or data set (for DATA_3DS) that the new points are associated with. Ignored for DATA_3DR. To generate a new curve, group, or data set, set Curve to 0.

*array1

Address of the X array for DATA_XYXY. Not used for other graph types.
If *array1=NULL, then X values will be set equal to the 0-based index of the point. (NOTE: This feature requires DPlot version 2.1.5 or later. Version 2.1.5 is the default minimum version for this version of DPLOTLIB.DLL. If you override the minimum version with a call to DPlot_MinVersion with a version prior to 2.1.5 and attempt to set the *array1 value to NULL, DPlot will almost certainly crash and possibly produce a Blue Screen of Death.)

*array2

Address of the Y array for DATA_XYXY

 

X,Y,Z triplets (in the order x(0),y(0),z(0),x(1),y(1),z(1),... etc.) for DATA_3DR or DATA_3DS

 

X,Y,Z,amplitude values for DATA_4D or DATA_4DS

 

Y (amplitude) array for DATA_1D

Return Values

1

Success

0

Generic error. For more specific error information use DPlot_SetErrorMode.

-1

Could not start DPlot or DPlot Jr.

-2

Could not initiate a DDE conversation with DPlot on the given document index.

-3

Unsupported DataType.

Remarks

This function, like DPlot_Command with [XY()], [XYXY()], or [XYZ()] commands, may be used in real-time applications. For best results with real-time applications and XY plots, use the ManualScale command to force the plot coordinates to the desired value. Otherwise, DPlot will continually adjust the plot coordinates to fit the incoming data. If the ManualScale command is issued DPlot keeps the extents of the X axis constant, shifting the plot window to the right when necessary.

 

 

 

 


Page url: http://www.dplot.com/lib/index.htm?dplot_adddata.htm