XYSetErrorData

XYSetErrorData sets the error data. The data is used to display error bars.

bool = XYSetErrorData(hData, ssXY, rvMinusError, rvPlusError)
bool = XYSetErrorData(hData, ssXY)

Return Value

bool is TRUE (1), if the values could be set and FALSE, if the function failed.

Parameters

hData

The handle of a dataset created with XYCreate or TYCreate.

ssXY

ssXY is “X” for the x-error, “Y” for the y-error.

rvMinusError

Vector with the negative error values.

rvPlusError

Vector with the positive error values. The number of values must match the rvMinusError and the number of data points in the dataset.

Comment

The positive error values are added to the data point and the minus error values are subtracted from the data value. An error value of 0 is not displayed. The number of data points is limited to 200,000. The number of error points must match the number of data points in the dataset.

When the version with two parameter is used the error data will be deleted.

Example

hDoc = DocCreate();
hPage = PageCreate();
hLayer = LayerCreate();
DocAddPage(hDoc, hPage);
PageAddLayer(hPage, hLayer);

rvX = [1, 2, 3, 4, 5];
rvY = [3, 5, 4, 6, 5];
rvMErr = [0.3, 0.4, 0.5, 0, 0.7];  // minus error
rvPErr = [0.2, 0.5, 0, 0.6, 0.3];  // plus error

hData = auto_xy_CreateErrorDataset(hLayer, "Test", rvX, rvY, rvMErr, rvPErr);
LayerAutoScale(hLayer);

rvConfig = XYGetErrorbarConfig(hData, "Y");
PenSetColor(rvConfig[1], [255,0,0]) // red
PenSetWidth(rvConfig[1], 5) // line width
rvConfig[2] = 5; // line width
rvConfig[3] = 0.3; // width in cm
XYSetErrorbarConfig(hData, "Y", rvConfig);

History

Version Description
R2018.1 New.

id-1820599