Skip to main content
`Ctrl`+`K`

# `actions`: Actions for PlotWidget

This package provides a set of QAction to use with `PlotWidget`

Those actions are useful to add menu items or toolbar items that interact with a `PlotWidget`.

It provides a base class used to define new plot actions: `PlotAction`.

For an introduction to creating custom plot actions, see Adding custom plot actions.

## actions API

Actions are divided into the following sub-modules:

- `silx.gui.plot.actions.control`
- `silx.gui.plot.actions.medfilt`
- `silx.gui.plot.actions.fit`
- `silx.gui.plot.actions.histogram`
- `silx.gui.plot.actions.io`

class PlotAction(plot, icon, text, tooltip=None, triggered=None, checkable=False, parent=None)

  Base class for QAction that operates on a PlotWidget.

  Parameters:

    - plot (`PlotWidget`) – `PlotWidget` instance on which to operate.

    - icon (`str` | `QIcon`) – QIcon or name of icon to use

    - text (`str`) – The name of this action to be used for menu label

    - tooltip (`str` | `None`) – The text of the tooltip

    - triggered (`Callable` | `None`) – The callback to connect to the action’s triggered signal. None for no callback (default)

    - checkable (`bool`) – True for checkable action, False otherwise (default)

    - parent (`QObject` | `None`) – See `QAction`.