.. highlightlang:: us .. _xysetfilterfunctions: XYSetFilterFunctions ==================== .. index:: XYSetFilterFunctions .. us.tag XYSetFilterFunctions xy.data New400 :ref:`XYSetFilterFunctions` sets one or more filter functions for a 2D dataset. .. function:: bool = XYSetFilterFunctions(hData, ssFilterFunctions) bool = XYSetFilterFunctions(hData, ssFilterFunctions, bUpdate) .. us.return **Return Value** *bool* is TRUE (1), when the function succeeds and FALSE (0), if it does not. .. us.params **Parameters** .. uparam:: hData The handle of a dataset created with :ref:`XYCreate` or :ref:`TYCreate`. .. uparam:: ssFilterFunctions *ssFilterFunctions* is a string with filter functions. The functions are separated by a semicolon (;), see example. .. uparam:: bUpdate If *bUpdate* = TRUE (1) the filter function will be evaluated and the dataset will display the filtered data. If *bUpdate* = FALSE (0), only the filter function is set. To start the caluculation the functions :ref:`XYUseFilter` and :ref:`XYUpdate` must be invoked. Default value is TRUE (1). .. us.example **Example** :: def test_XYSetFilterFunctions() { x = linspace(0, 2*PI, 1000); srand(1); h = plot(x , sin(x + rand(1,1000)*0.2)); hData = h[3]; XYSetFilterFunctions(hData, "smooth(10);fitspline(1.0);simplify(5)"); } test_XYSetFilterFunctions(); :: auto_AddToUI("Examples", "Example", "RS_Example3"); def RS_Example3() { auto_SetFileNameDialogInit("*.asc; *.nc", GetRootDirectory() + "samples/"); svFile = auto_GetFileNameDialog(3); if (svFile[1] == "DLG_CANCEL") { return; } NumberOfFiles = len(svFile); hPage = auto_LoadTemplate("example"); for (i in 1:NumberOfFiles) { svFile[i] = auto_ImportData(svFile[i]); hData = auto_LoadDataset("Diagramm 1", "rpm", "torque"); XYSetFilterFunctions(hData, "akimaspline()"); hData = auto_LoadDataset("Diagramm 2", "rpm", "power"); XYSetFilterFunctions(hData, "akimaspline()"); } auto_ScaleAxes(); auto_ReplaceTextDialog(svFile[1]); auto_UpdatePage(); } .. us.comment **Comment** For a list of filter functions see :ref:`filter-functions-for-xy-datasets`.To specify the filter interactively choose :ref:`data1d-and-2d-dataset`. .. seealso:: :ref:`overview-xy-datasets`, :ref:`XYGetFilterFunctions`, :ref:`XYUpdate`, :ref:`XYUseFilter` :sub:`id-1132714`