Skip to main content
`Ctrl`+`K`

# `silx.gui.plot.actions.fit`

`silx.gui.plot.actions.fit` module provides actions relative to fit.

The following QAction are available:

- `FitAction`

class FitAction(plot, parent=None)

  QAction to open a `FitWidget` and set its data to the active curve if any, or to the first curve.

  Parameters:

    - plot – `PlotWidget` instance on which to operate

    - parent – See `QAction`

  getXRange()

    Returns the range on the X axis on which to perform the fit.

  setXRangeUpdatedOnZoom(enabled)

    Set whether or not to update the X range on zoom change.

    Parameters:

      enabled (bool)

  isXRangeUpdatedOnZoom()

    Returns the current mode of fitted data X range update.

    Return type:

      bool

  getXData(copy=True)

    Returns the X data used for the fit or None if undefined.

    Parameters:

      copy (bool) – True to get a copy of the data, False to get the internal data.

    Return type:

      Union[numpy.ndarray,None]

  getYData(copy=True)

    Returns the Y data used for the fit or None if undefined.

    Parameters:

      copy (bool) – True to get a copy of the data, False to get the internal data.

    Return type:

      Union[numpy.ndarray,None]

  setFittedItemUpdatedFromActiveCurve(enabled)

    Toggle fitted data synchronization with plot active curve.

    Parameters:

      enabled (bool)

  isFittedItemUpdatedFromActiveCurve()

    Returns True if fitted data is synchronized with plot.

    Return type:

      bool