.. highlightlang:: us .. index:: XYSetErrorData .. _xyseterrordata: XYSetErrorData ============== .. us.tag XYSetErrorData ENGLISH xy.data New6001 :ref:`XYSetErrorData` sets the error data. The data is used to display error bars. .. function:: bool = XYSetErrorData(hData, ssXY, rvMinusError, rvPlusError) bool = XYSetErrorData(hData, ssXY) .. us.return **Return Value** *bool* is TRUE (1), if the values could be set and FALSE, if the function failed. .. us.params **Parameters** .. uparam:: hData The handle of a dataset created with :ref:`XYCreate` or :ref:`TYCreate`. .. uparam:: ssXY *ssXY* is "X" for the x-error, "Y" for the y-error. .. uparam:: rvMinusError Vector with the negative error values. .. uparam:: rvPlusError Vector with the positive error values. The number of values must match the *rvMinusError* and the number of data points in the dataset. .. us.comment **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. .. us.example **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** .. list-table:: :header-rows: 1 * - Version - Description * - R2018.1 - New. .. seealso:: :ref:`overview-xy-datasets`, :ref:`XYGetErrorData`, :ref:`XYGetErrorbarConfig`, :ref:`XYCreate`, :ref:`XYSetData`, :ref:`XYSetGetOrgDataFlag` :sub:`id-1820599`