Skip to main content
`Ctrl`+`K`

# `plot`: 1D and 2D Plot widgets

This package provides a set of Qt widgets for plotting curves and images.

The plotting API is inherited from the PyMca plot API and is mostly compatible with it.

Those widgets supports interaction (e.g., zoom, pan, selections).

List of Qt widgets:

- `PlotWidget`: A widget displaying a single plot.

- `PlotWindow`: A `PlotWidget` with a configurable set of tools.

- `Plot1D`: A widget with tools for curves.

- `Plot2D`: A widget with tools for images.

- `ScatterView`: A widget with tools for scatter plot.

- `ImageView`: A widget with tools for images and a side histogram.

- `StackView`: A widget with tools for a stack of images.

By default, those widget are using matplotlib. They can optionally use a faster OpenGL-based rendering (beta feature), which is enabled by setting the `backend` argument to `'gl'` when creating the widgets (See `PlotWidget`).

Note

This package depends on matplotlib. The OpenGL backend further depends on PyOpenGL and OpenGL >= 2.1.

For an introduction to the widgets of this package, see Getting started with plot widgets.

For examples of custom plot actions, see Adding custom plot actions.

## Widgets gallery

See silx.gui.plot Widgets gallery.

## Public modules

Main plot widgets:

- `PlotWidget`: Base class for plotting widgets
  - `PlotWidget`
- `PlotWindow`: Plot widget with toolbar
  - `PlotWindow` class
  - `Plot1D`: Plot curves
  - `Plot2D`: Plot images
- `ComplexImageView`: Plot a 2D array of complex
  - `ComplexImageView` class
- `ImageView`: Plot an image with side histograms
  - `ImageView` class
- `StackView`: Plot a stack of images
  - `StackView` class
  - `StackViewMainWindow` class
- `ScatterView`: Plot 2D scatter data
  - `ScatterView` class
- `CompareImages`: Plot 2 images to compare them
  - `CompareImages` class

Classes describing plot content:

- `Colormap`

- `items`: Plot primitives
  - Item
  - Curve
  - Images
  - Scatter
  - Histogram
  - Markers
  - Shapes
  - Item changed signal
  - Axis
  - `roi`: Regions of Interest

Additionnal plot tool widgets:

- `actions`: Actions for PlotWidget
  - actions API
- `PlotToolButtons`: QToolButtons for plot widgets
  - `AspectToolButton`
  - `YAxisOriginToolButton`
  - `ProfileOptionToolButton`
  - `ProfileToolButton`
  - `SymbolToolButton`
  - `ScatterVisualizationToolButton`
- `tools`: Tool widgets for PlotWidget
  - Tools API
  - Other tools API
  - `PositionInfo` class
  - `LimitsToolBar` class
  - `InteractiveModeToolBar` class
  - `OutputToolBar` class
  - `ImageToolBar` class
  - `CurveToolBar` class
  - `ScatterToolBar` class
  - `CurveLegendsWidget`
  - `roi`: Region of interest
- `ColorBar`: ColorBar Widget
  - `ColorBarWidget` class
- `Profile`: Toolbars with profile tools
  - `ProfileToolBar` class
  - `Profile3DToolBar` class
- `CurvesROIWidget`: ROI from curves
  - `ROI` class
  - `CurvesROIWidget` class
  - `ROITable` class
- `PrintPreviewToolButton`: Print preview buttons
  - Classes
  - Examples
  - `PrintPreviewToolButton`
  - `SingletonPrintPreviewToolButton`
- `StatsWidget`: Display a set of statictics for plot items
  - `StatsWidget` class
  - `BasicStatsWidget` class
  - `StatsTable` class
  - `BasicLineStatsWidget` class
  - `BasicGridStatsWidget` class
- `ROIStatsWidget`: Display a set of statistics for couples (plot items, roi)
  - `ROIStatsWidget` class
  - `ROIStatsItemHelper` class
- `stats`: Stats for PlotWidget
  - stats API

Utilities

- `axis`: utilities for plots
  - SyncAxes

## Internals

- Package structure
- Modules
  - `backends.BackendBase`
  - `CurvesROIWidget`
  - `Interaction`
  - `LegendSelector`
  - `_BaseMaskToolsWidget`
  - `MaskToolsWidget`
  - `ScatterMaskToolsWidget`
  - `PlotEvents`
  - `PlotInteraction`
  - `_utils`