PlotWindow: Plot widget with toolbar

PlotWindow class

class silx.gui.plot.PlotWindow.PlotWindow(parent=None, backend=None, resetzoom=True, autoScale=True, logScale=True, grid=True, curveStyle=True, colormap=True, aspectRatio=True, yInverted=True, copy=True, save=True, print_=True, control=False, position=False, roi=True, mask=True, fit=False)[source]

Bases: silx.gui.plot.PlotWidget.PlotWidget

Qt Widget providing a 1D/2D plot area and additional tools.

This widgets inherits from PlotWidget and provides its plot API.

This widget includes the following QAction as attributes:

  • resetZoomAction: Reset zoom
  • xAxisAutoScaleAction: Toggle X axis autoscale
  • yAxisAutoScaleAction: Toggle Y axis autoscale
  • xAxisLogarithmicAction: Toggle X axis log scale
  • yAxisLogarithmicAction: Toggle Y axis log scale
  • gridAction: Toggle plot grid
  • curveStyleAction: Change curve line and markers style
  • colormapAction: Open a colormap dialog to change active image and default colormap.
  • keepDataAspectRatioButton: QToolButton to set keep data aspect ratio.
  • keepDataAspectRatioAction: Action associated to keepDataAspectRatioButton. Use this to change the visibility of keepDataAspectRatioButton in the toolbar (See QToolBar.addWidget() documentation).
  • yAxisInvertedButton: QToolButton to set Y Axis direction.
  • yAxisInvertedAction: Action associated to yAxisInvertedButton. Use this to change the visibility yAxisInvertedButton in the toolbar. (See QToolBar.addWidget() documentation).
  • copyAction: Copy plot snapshot to clipboard
  • saveAction: Save plot
  • printAction: Print plot
  • fitAction: Fit selected curve

Initialiser parameters:

Parameters:
  • parent – The parent of this widget or None.
  • backend (str or BackendBase.BackendBase) – The backend to use for the plot. The default is to use matplotlib.
  • resetzoom (bool) – Toggle visibility of reset zoom action.
  • autoScale (bool) – Toggle visibility of axes autoscale actions.
  • logScale (bool) – Toggle visibility of axes log scale actions.
  • grid (bool) – Toggle visibility of grid mode action.
  • curveStyle (bool) – Toggle visibility of curve style action.
  • colormap (bool) – Toggle visibility of colormap action.
  • aspectRatio (bool) – Toggle visibility of aspect ratio button.
  • yInverted (bool) – Toggle visibility of Y axis direction button.
  • copy (bool) – Toggle visibility of copy action.
  • save (bool) – Toggle visibility of save action.
  • print (bool) – Toggle visibility of print action.
  • control (bool) – True to display an Options button with a sub-menu to show legends, toggle crosshair and pan with arrows. (Default: False)
  • position – True to display widget with (x, y) mouse position (Default: False). It also supports a list of (name, funct(x, y)->value) to customize the displayed values. See silx.gui.plot.PlotTools.PositionInfo.
  • roi (bool) – Toggle visibilty of ROI action.
  • mask (bool) – Toggle visibilty of mask action.
  • fit (bool) – Toggle visibilty of fit action.
legendsDockWidget[source]

DockWidget with Legend panel (lazy-loaded).

curvesROIDockWidget[source]

DockWidget with curves’ ROI panel (lazy-loaded).

roiAction[source]

QAction toggling curve ROI dock widget

maskToolsDockWidget[source]

DockWidget with image mask panel (lazy-loaded).

maskAction[source]

QAction toggling image mask dock widget

getSelectionMask()[source]

Return the current mask handled by maskToolsDockWidget.

Returns:The array of the mask with dimension of the ‘active’ image. If there is no active image, an empty array is returned.
Return type:2D numpy.ndarray of uint8
setSelectionMask(mask)[source]

Set the mask handled by :attr`maskToolsDockWidget`.

If the provided mask has not the same dimension as the ‘active’ image, it will by cropped or padded.

Parameters:mask (numpy.ndarray of uint8 of dimension 2, C-contiguous. Array of other types are converted.) – The array to use for the mask.
Returns:True if success, False if failed
consoleDockWidget[source]

DockWidget with IPython console (lazy-loaded).

crosshairAction[source]

Action toggling crosshair cursor mode (lazy-loaded).

panWithArrowKeysAction[source]

Action toggling pan with arrow keys (lazy-loaded).

toolBar()[source]

Return a QToolBar from the QAction of the PlotWindow.

menu(title='Plot', parent=None)[source]

Return a QMenu from the QAction of the PlotWindow.

Parameters:
  • title (str) – The title of the QMenu
  • parent – See QMenu

Plot1D: Plot curves

class silx.gui.plot.PlotWindow.Plot1D(parent=None)[source]

Bases: silx.gui.plot.PlotWindow.PlotWindow

PlotWindow with tools specific for curves.

This widgets provides the plot API of PlotWidget.

Parameters:parent – The parent of this widget

Plot2D: Plot images

class silx.gui.plot.PlotWindow.Plot2D(parent=None)[source]

Bases: silx.gui.plot.PlotWindow.PlotWindow

PlotWindow with a toolbar specific for images.

This widgets provides the plot API of PlotWidget.

Parameters:parent – The parent of this widget
profile = None

“Profile tools attached to this plot.

See silx.gui.plot.PlotTools.ProfileToolBar

Table Of Contents

Previous topic

PlotWidget: Base class for plotting widgets

Next topic

ImageView: Plot an image with side histograms

This Page