.. highlightlang:: us .. index:: auto_xy_Sub .. _auto_xy_sub: auto_xy_Sub =========== .. us.tag auto_xy_Sub NOTREADYENGLISH auto_xy :ref:`auto_xy_Sub` creates a new dataset by subtracting the y coordinates of the given 2D datasets. .. function:: hDataNew = auto_xy_Sub(hData, hvData) hDataNew = auto_xy_Sub(hData_Layer, hvData) .. us.return **Return Value** *hDataNew* is the handle of the new dataset. .. us.params **Parameters** .. uparam:: hData *hData* is the handle of a 2D dataset. The new dataset *hDataNew* will be added to the layer (diagram) in which the dataset *hData* is located. .. uparam:: hData_Layer *hData_Layer* is a vector with one or two elements: .. list-table:: :header-rows: 1 * - Value - Meaning * - hData_Layer[1] - Handle of a dataset. The new dataset is added to the diagram to which the dataset hData_Layer[1] belongs. * - hData_Layer[1, 2] - The first element is the handle of a dataset and the second element is the handle of diagram (layer). The new dataset is added to the diagram with the handle hData_Layer[2]. .. uparam:: hvData *hvData* is a vector of handles of 2D Datasets. .. us.comment **Comment** The x coordinates of all given datasets must be strictly increasing The x coordinates of the given datasets do not have to be identical. The new dataset is calculated as following: * The x-range is calculated where all datasets overlap. * The the new x-range a new x-coordinate vector (xs) is calculated which contain the x-coordinates of all given datasets. * The y-coordinates for each datasets for the new x-vector xs is calculated by linear interpolation. * The interpolated y-coordinates are subtracted (ysub = Y1 - (Y2+Y3+..)). * A new dataset will be created (xs, ysub). .. seealso:: :ref:`overview-automation`, :ref:`PageGetLayerHandle` :sub:`id-120110`