PlotWindow: Plot widget with toolbar
A PlotWidget with additional toolbars.
The PlotWindow is a subclass of PlotWidget.
It provides the plot API fully defined in Plot.
-
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.
Initialiser parameters:
Parameters: |
- parent – The parent of this widget or None.
- backend (str or BackendBase.BackendBase) – The backend to use for the plot (default: matplotlib).
See Plot for the list of supported backend.
- 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.
|
-
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 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 |
-
toolBar()[source]
Return a QToolBar from the QAction of the PlotWindow.
Return a QMenu from the QAction of the PlotWindow.
Parameters: |
- title (str) – The title of the QMenu
- parent – See QMenu
|
-
addTabbedDockWidget(dock_widget)[source]
Add a dock widget as a new tab if there are already dock widgets
in the plot. When the first tab is added, the area is chosen
depending on the plot geometry:
it the window is much wider than it is high, the right dock area
is used, else the bottom dock area is used.
Parameters: | dock_widget – Instance of QDockWidget to be added. |
-
getLegendsDockWidget()[source]
DockWidget with Legend panel
-
getCurvesRoiDockWidget()[source]
DockWidget with curves’ ROI panel (lazy-loaded).
The widget returned is a CurvesROIDockWidget.
Its central widget is a CurvesROIWidget
accessible as CurvesROIDockWidget.roiWidget.
silx.gui.plot.CurvesROIWidget.CurvesROIWidget offers a getter
and a setter for the ROI data:
- CurvesROIWidget.getRois()
- CurvesROIWidget.setRois()
-
getMaskToolsDockWidget()[source]
DockWidget with image mask panel (lazy-loaded).
-
getConsoleAction()[source]
QAction handling the IPython console activation.
By default, it is connected to a method that initializes the
console widget the first time the user clicks the “Console” menu
button. The following clicks, after initialization is done,
will toggle the visibility of the console widget.
-
getCrosshairAction()[source]
Action toggling crosshair cursor mode.
Return type: | PlotActions.PlotAction |
-
getMaskAction()[source]
QAction toggling image mask dock widget
-
getPanWithArrowKeysAction()[source]
Action toggling pan with arrow keys.
Return type: | PlotActions.PlotAction |
-
getRoiAction()[source]
QAction toggling curve ROI dock widget
-
getResetZoomAction()[source]
Action resetting the zoom
Return type: | PlotActions.PlotAction |
-
getZoomInAction()[source]
Action to zoom in
Return type: | PlotActions.PlotAction |
-
getZoomOutAction()[source]
Action to zoom out
Return type: | PlotActions.PlotAction |
-
getXAxisAutoScaleAction()[source]
Action to toggle the X axis autoscale on zoom reset
Return type: | PlotActions.PlotAction |
-
getYAxisAutoScaleAction()[source]
Action to toggle the Y axis autoscale on zoom reset
Return type: | PlotActions.PlotAction |
-
getXAxisLogarithmicAction()[source]
Action to toggle logarithmic X axis
Return type: | PlotActions.PlotAction |
-
getYAxisLogarithmicAction()[source]
Action to toggle logarithmic Y axis
Return type: | PlotActions.PlotAction |
-
getGridAction()[source]
Action to toggle the grid visibility in the plot
Return type: | PlotActions.PlotAction |
-
getCurveStyleAction()[source]
Action to change curve line and markers styles
Return type: | PlotActions.PlotAction |
-
getColormapAction()[source]
Action open a colormap dialog to change active image
and default colormap.
Return type: | PlotActions.PlotAction |
-
getKeepDataAspectRatioButton()[source]
Button to toggle aspect ratio preservation
Return type: | PlotToolButtons.AspectToolButton |
-
getKeepDataAspectRatioAction()[source]
Action associated to keepDataAspectRatioButton.
Use this to change the visibility of keepDataAspectRatioButton in the
toolbar (See QToolBar.addWidget() documentation).
Return type: | PlotActions.PlotAction |
-
getYAxisInvertedButton()[source]
Button to switch the Y axis orientation
Return type: | PlotToolButtons.YAxisOriginToolButton |
-
getYAxisInvertedAction()[source]
Action associated to yAxisInvertedButton.
Use this to change the visibility yAxisInvertedButton in the toolbar.
(See QToolBar.addWidget() documentation).
Return type: | PlotActions.PlotAction |
-
getIntensityHistogramAction()[source]
Action toggling the histogram intensity Plot widget
Return type: | PlotActions.PlotAction |
-
getCopyAction()[source]
Action to copy plot snapshot to clipboard
Return type: | PlotActions.PlotAction |
-
getSaveAction()[source]
Action to save plot
Return type: | PlotActions.PlotAction |
-
getPrintAction()[source]
Action to print plot
Return type: | PlotActions.PlotAction |
-
getFitAction()[source]
Action to fit selected curve
Return type: | PlotActions.PlotAction |
-
getMedianFilter1DAction()[source]
Action toggling the 1D median filter
Return type: | PlotActions.PlotAction |
-
getMedianFilter2DAction()[source]
Action toggling the 2D median filter
Return type: | PlotActions.PlotAction |
Plot1D: Plot curves
-
class silx.gui.plot.PlotWindow.Plot1D(parent=None, backend=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
- backend (str or BackendBase.BackendBase) – The backend to use for the plot (default: matplotlib).
See Plot for the list of supported backend.
|
Plot2D: Plot images
-
class silx.gui.plot.PlotWindow.Plot2D(parent=None, backend=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
- backend (str or BackendBase.BackendBase) – The backend to use for the plot (default: matplotlib).
See Plot for the list of supported backend.
|
-
getProfileToolbar()[source]
Profile tools attached to this plot
See silx.gui.plot.Profile.ProfileToolBar
-
getProfilePlot()[source]
Return plot window used to display profile curve.