.. highlightlang:: us .. index:: auto_xy_CreateErrorDataset .. index:: auto_xy_CreateErrorDatasetEx .. _auto_xy_CreateErrorDataset: auto_xy_CreateErrorDataset ========================== .. us.tag auto_xy_CreateErrorDataset ENGLISH auto_xy New6001 :ref:`auto_xy_CreateErrorDataset` creates a new 2D dataset with error data. .. function:: hData = auto_xy_CreateErrorDataset(hLayer, ssName, rvX, rvY, rvMinusError, rvPlusError) hData = auto_xy_CreateErrorDatasetEx(hLayer, ncid, svVarName) hData = auto_xy_CreateErrorDatasetEx(hLayer, ncid, svVarName, oParameter) hData = auto_xy_CreateErrorDatasetEx(hLayer, ssNCName, svVarName) hData = auto_xy_CreateErrorDatasetEx(hLayer, ssNCName, svVarName, oParameter) .. us.return **Return Value** *hData* is the handle of the new datasets or 0 in case of an error. .. us.params **Parameters** .. uparam:: hLayer *hLayer* is the diagram handle (see :ref:`PageGetLayerHandle`). .. uparam:: ssName *ssName* is the name of the dataset to be created by :ref:`XYCreate`. .. uparam:: rvX *rvX* is a vector with x-coordinates. .. uparam:: rvY *rvY* is a vector with y-coordinates. .. uparam:: rvMinusError *rvMinusError* is a vector with the negative error values. .. uparam:: rvPlusError *rvPlusError* is a vector with the positive error values. The number of values must match the *rvMinusError* and the number of data points in the dataset. .. uparam:: ncid *ncid* is the handle of an NC file, returned by :ref:`nc_create` or :ref:`nc_open`. .. uparam:: ssNCFile *ssNCFile* is the name of an NC file. .. uparam:: svVarName *svVarName* is a string vector with 4 channel names: ``["x", "y", "minusError", "plusError"]``. The x, y, minus and plus errors will be read from those channels. .. uparam:: oParameter *oParameter* is an object with optional parameters, for example ``[. bXSort = TRUE ]``. .. list-table:: :header-rows: 1 * - Element Name - Description - Default Value * - ``bXSort`` - Sort by x. - ``FALSE`` .. 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. .. 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-automation`, :ref:`XYSetErrorData`, :sub:`id-999724`