PlotActions: Actions for PlotWidget¶
The PlotAction is a base class used to define plot actions.
Plot actions serve to add menu items or toolbar items that are associated with a method
that can interact with the associated PlotWidget.
For an introduction to creating custom plot actions, see Adding custom plot actions.
PlotActions API¶
This module provides a set of QAction to use with PlotWidget.
The following QAction are available:
ColormapActionCopyActionCrosshairActionCurveStyleActionFitActionGridActionKeepAspectRatioActionPanWithArrowKeysActionPrintActionResetZoomActionSaveActionXAxisLogarithmicActionXAxisAutoScaleActionYAxisInvertedActionYAxisLogarithmicActionYAxisAutoScaleActionZoomInActionZoomOutAction
-
class
silx.gui.plot.PlotActions.PlotAction(plot, icon, text, tooltip=None, triggered=None, checkable=False, parent=None)[source]¶ Base class for QAction that operates on a PlotWidget.
Parameters: - plot –
PlotWidgetinstance on which to operate. - icon – QIcon or str name of icon to use
- text (str) – The name of this action to be used for menu label
- tooltip (str) – The text of the tooltip
- triggered – The callback to connect to the action’s triggered signal or None for no callback.
- checkable (bool) – True for checkable action, False otherwise (default)
- parent – See
QAction.
-
plot¶ The
PlotWidgetthis action group is controlling.
- plot –
-
class
silx.gui.plot.PlotActions.ResetZoomAction(plot, parent=None)[source]¶ QAction controlling reset zoom on a
PlotWidget.Parameters: - plot –
PlotWidgetinstance on which to operate - parent – See
QAction
- plot –
-
class
silx.gui.plot.PlotActions.ZoomInAction(plot, parent=None)[source]¶ QAction performing a zoom-in on a
PlotWidget.Parameters: - plot –
PlotWidgetinstance on which to operate - parent – See
QAction
- plot –
-
class
silx.gui.plot.PlotActions.ZoomOutAction(plot, parent=None)[source]¶ QAction performing a zoom-out on a
PlotWidget.Parameters: - plot –
PlotWidgetinstance on which to operate - parent – See
QAction
- plot –
-
class
silx.gui.plot.PlotActions.XAxisAutoScaleAction(plot, parent=None)[source]¶ QAction controlling X axis autoscale on a
PlotWidget.Parameters: - plot –
PlotWidgetinstance on which to operate - parent – See
QAction
- plot –
-
class
silx.gui.plot.PlotActions.YAxisAutoScaleAction(plot, parent=None)[source]¶ QAction controlling Y axis autoscale on a
PlotWidget.Parameters: - plot –
PlotWidgetinstance on which to operate - parent – See
QAction
- plot –
-
class
silx.gui.plot.PlotActions.XAxisLogarithmicAction(plot, parent=None)[source]¶ QAction controlling X axis log scale on a
PlotWidget.Parameters: - plot –
PlotWidgetinstance on which to operate - parent – See
QAction
- plot –
-
class
silx.gui.plot.PlotActions.YAxisLogarithmicAction(plot, parent=None)[source]¶ QAction controlling Y axis log scale on a
PlotWidget.Parameters: - plot –
PlotWidgetinstance on which to operate - parent – See
QAction
- plot –
-
class
silx.gui.plot.PlotActions.GridAction(plot, gridMode='both', parent=None)[source]¶ QAction controlling grid mode on a
PlotWidget.Parameters: - plot –
PlotWidgetinstance on which to operate - gridMode (str) – The grid mode to use in ‘both’, ‘major’.
See
PlotWidget.setGraphGrid() - parent – See
QAction
- plot –
-
class
silx.gui.plot.PlotActions.CurveStyleAction(plot, parent=None)[source]¶ QAction controlling curve style on a
PlotWidget.It changes the default line and markers style which updates all curves on the plot.
Parameters: - plot –
PlotWidgetinstance on which to operate - parent – See
QAction
- plot –
-
class
silx.gui.plot.PlotActions.ColormapAction(plot, parent=None)[source]¶ QAction opening a ColormapDialog to update the colormap.
Both the active image colormap and the default colormap are updated.
Parameters: - plot –
PlotWidgetinstance on which to operate - parent – See
QAction
- plot –
-
class
silx.gui.plot.PlotActions.KeepAspectRatioAction(plot, parent=None)[source]¶ QAction controlling aspect ratio on a
PlotWidget. :param plot:PlotWidgetinstance on which to operate :param parent: SeeQAction
-
class
silx.gui.plot.PlotActions.YAxisInvertedAction(plot, parent=None)[source]¶ QAction controlling Y orientation on a
PlotWidget.Parameters: - plot –
PlotWidgetinstance on which to operate - parent – See
QAction
- plot –
-
class
silx.gui.plot.PlotActions.SaveAction(plot, parent=None)[source]¶ QAction for saving Plot content.
It opens a Save as... dialog.
Parameters: - plot –
PlotWidgetinstance on which to operate. - parent – See
QAction.
- plot –
-
class
silx.gui.plot.PlotActions.PrintAction(plot, parent=None)[source]¶ QAction for printing the plot.
It opens a Print dialog.
Current implementation print a bitmap of the plot area and not vector graphics, so printing quality is not great.
Parameters: - plot –
PlotWidgetinstance on which to operate. - parent – See
QAction.
-
printer¶ The QPrinter instance used by the actions.
This is shared accross all instances of PrintAct
- plot –
-
class
silx.gui.plot.PlotActions.CopyAction(plot, parent=None)[source]¶ QAction to copy
PlotWidgetcontent to clipboard.Parameters: - plot –
PlotWidgetinstance on which to operate - parent – See
QAction
- plot –
-
class
silx.gui.plot.PlotActions.CrosshairAction(plot, color='black', linewidth=1, linestyle='-', parent=None)[source]¶ QAction toggling crosshair cursor on a
PlotWidget.Parameters: - plot –
PlotWidgetinstance on which to operate - color (str) – Color to use to draw the crosshair
- linewidth (int) – Width of the crosshair cursor
- linestyle (str) – Style of line. See
Plot.setGraphCursor() - parent – See
QAction
-
color= None¶ Color used to draw the crosshair (str).
-
linewidth= None¶ Width of the crosshair cursor (int).
-
linestyle= None¶ Style of line of the cursor (str).
- plot –
-
class
silx.gui.plot.PlotActions.PanWithArrowKeysAction(plot, parent=None)[source]¶ QAction toggling pan with arrow keys on a
PlotWidget.Parameters: - plot –
PlotWidgetinstance on which to operate - parent – See
QAction
- plot –
-
class
silx.gui.plot.PlotActions.FitAction(plot, parent=None)[source]¶ QAction to open a
FitWidgetand set its data to the active curve if any, or to the first curve.Parameters: - plot –
PlotWidgetinstance on which to operate - parent – See
QAction
- plot –
-
class
silx.gui.plot.PlotActions.PixelIntensitiesHistoAction(plot, parent=None)[source]¶ QAction to plot the pixels intensities diagram
Parameters: - plot –
PlotWidgetinstance on which to operate - parent – See
QAction
-
computeIntensityDistribution()[source]¶ Get the active image and compute the image intensity distribution
-
eventFilter(qobject, event)[source]¶ Observe when the close event is emitted then simply uncheck the action button
Parameters: - qobject – the object observe
- event – the event received by qobject
- plot –
-
class
silx.gui.plot.PlotActions.MedianFilterAction(plot, parent=None)[source]¶ QAction to plot the pixels intensities diagram
Parameters: - plot –
PlotWidgetinstance on which to operate - parent – See
QAction
- plot –
-
class
silx.gui.plot.PlotActions.MedianFilter1DAction(plot, parent=None)[source]¶ Define the MedianFilterAction for 1D
Parameters: - plot –
PlotWidgetinstance on which to operate - parent – See
QAction
- plot –
-
class
silx.gui.plot.PlotActions.MedianFilter2DAction(plot, parent=None)[source]¶ Define the MedianFilterAction for 2D
Parameters: - plot –
PlotWidgetinstance on which to operate - parent – See
QAction
- plot –