darfix.gui.PCAWidget.PCAPlot#

class darfix.gui.PCAWidget.PCAPlot(parent=None, backend=None)[source]#

Bases: Plot1D

AllowNestedDocks = 2#
AllowTabbedDocks = 4#
AnimatedDocks = 1#
class DockOption#

Bases: int

class DockOptions#
class DockOptions(f: QMainWindow.DockOptions | QMainWindow.DockOption)
class DockOptions(a0: QMainWindow.DockOptions)

Bases: simplewrapper

DrawChildren = 2#
DrawWindowBackground = 1#
ForceTabbedDocks = 8#
GroupedDragging = 32#
ITEM_KINDS = ('curve', 'image', 'scatter', 'item', 'marker', 'histogram')#

List of supported kind of items in the plot.

IgnoreMask = 4#
class PaintDeviceMetric#

Bases: int

PdmDepth = 6#
PdmDevicePixelRatio = 11#
PdmDevicePixelRatioScaled = 12#
PdmDpiX = 7#
PdmDpiY = 8#
PdmHeight = 2#
PdmHeightMM = 4#
PdmNumColors = 5#
PdmPhysicalDpiX = 9#
PdmPhysicalDpiY = 10#
PdmWidth = 1#
PdmWidthMM = 3#
class RenderFlag#

Bases: int

class RenderFlags#
class RenderFlags(f: QWidget.RenderFlags | QWidget.RenderFlag)
class RenderFlags(a0: QWidget.RenderFlags)

Bases: simplewrapper

VerticalTabs = 16#
acceptDrops(self) bool#
accessibleDescription(self) str#
accessibleName(self) str#
actionEvent(self, a0: QActionEvent | None)#
actions(self) List[QAction]#
activateWindow(self)#
addAction(self, action: QAction | None)#
addActions(self, actions: Iterable[QAction])#
addCurve(x, y, legend=None, info=None, replace=False, color=None, symbol=None, linewidth=None, linestyle=None, xlabel=None, ylabel=None, yaxis=None, xerror=None, yerror=None, z=None, selectable=None, fill=None, resetzoom=True, histogram=None, copy=True, baseline=None)#

Add a 1D curve given by x an y to the graph.

Curves are uniquely identified by their legend. To add multiple curves, call addCurve() multiple times with different legend argument. To replace an existing curve, call addCurve() with the existing curve legend. If you want to display the curve values as an histogram see the histogram parameter or addHistogram().

When curve parameters are not provided, if a curve with the same legend is displayed in the plot, its parameters are used.

Parameters:
  • x (numpy.ndarray) – The data corresponding to the x coordinates. If you attempt to plot an histogram you can set edges values in x. In this case len(x) = len(y) + 1. If x contains datetime objects the XAxis tickMode is set to TickMode.TIME_SERIES.

  • y (numpy.ndarray) – The data corresponding to the y coordinates

  • legend (str) – The legend to be associated to the curve (or None)

  • info – User-defined information associated to the curve

  • replace (bool) – True to delete already existing curves (the default is False)

  • color (str ("#RRGGBB") or (npoints, 4) unsigned byte array or one of the predefined color names defined in colors.py) – color(s) to be used

  • symbol (str) –

    Symbol to be drawn at each (x, y) position:

    - 'o' circle
    - '.' point
    - ',' pixel
    - '+' cross
    - 'x' x-cross
    - 'd' diamond
    - 's' square
    - None (the default) to use default symbol
    

  • linewidth (float) – The width of the curve in pixels (Default: 1).

  • linestyle (str) –

    Type of line:

    - ' '  no line
    - '-'  solid line
    - '--' dashed line
    - '-.' dash-dot line
    - ':'  dotted line
    - None (the default) to use default line style
    

  • xlabel (str) – Label to show on the X axis when the curve is active or None to keep default axis label.

  • ylabel (str) – Label to show on the Y axis when the curve is active or None to keep default axis label.

  • yaxis (str) – The Y axis this curve is attached to. Either ‘left’ (the default) or ‘right’

  • xerror (A float, or a numpy.ndarray of float32. If it is an array, it can either be a 1D array of same length as the data or a 2D array with 2 rows of same length as the data: row 0 for lower errors, row 1 for upper errors.) – Values with the uncertainties on the x values

  • yerror (A float, or a numpy.ndarray of float32. See xerror.) – Values with the uncertainties on the y values

  • z (int) – Layer on which to draw the curve (default: 1) This allows to control the overlay.

  • selectable (bool) – Indicate if the curve can be selected. (Default: True)

  • fill (bool) – True to fill the curve, False otherwise (default).

  • resetzoom (bool) – True (the default) to reset the zoom.

  • histogram (str) –

    if not None then the curve will be draw as an histogram. The step for each values of the curve can be set to the left, center or right of the original x curve values. If histogram is not None and len(x) == len(y)+1 then x is directly take as edges of the histogram. Type of histogram:

    - None (default)
    - 'left'
    - 'right'
    - 'center'
    

  • copy (bool) – True make a copy of the data (default), False to use provided arrays.

  • baseline – curve baseline

Type:

Union[None,float,numpy.ndarray]

Returns:

The curve item

addDockWidget(self, area: Qt.DockWidgetArea, dockwidget: QDockWidget | None)#
addDockWidget(self, area: Qt.DockWidgetArea, dockwidget: QDockWidget | None, orientation: Qt.Orientation) None
addHistogram(histogram, edges, legend=None, color=None, fill=None, align='center', resetzoom=True, copy=True, z=None, baseline=None)#

Add an histogram to the graph.

This is NOT computing the histogram, this method takes as parameter already computed histogram values.

Histogram are uniquely identified by their legend. To add multiple histograms, call addHistogram() multiple times with different legend argument.

When histogram parameters are not provided, if an histogram with the same legend is displayed in the plot, its parameters are used.

Parameters:
  • histogram (numpy.ndarray) – The values of the histogram.

  • edges (numpy.ndarray) – The bin edges of the histogram. If histogram and edges have the same length, the bin edges are computed according to the align parameter.

  • legend (str) – The legend to be associated to the histogram (or None)

  • color (str ("#RRGGBB") or RGB unsigned byte array or one of the predefined color names defined in colors.py) – color to be used

  • fill (bool) – True to fill the curve, False otherwise (default).

  • align (str) – In case histogram values and edges have the same length N, the N+1 bin edges are computed according to the alignment in: ‘center’ (default), ‘left’, ‘right’.

  • resetzoom (bool) – True (the default) to reset the zoom.

  • copy (bool) – True make a copy of the data (default), False to use provided arrays.

  • z (int) – Layer on which to draw the histogram

  • baseline – histogram baseline

Type:

Union[None,float,numpy.ndarray]

Returns:

The histogram item

addImage(data, legend=None, info=None, replace=False, z=None, selectable=None, draggable=None, colormap=None, pixmap=None, xlabel=None, ylabel=None, origin=None, scale=None, resetzoom=True, copy=True)#

Add a 2D dataset or an image to the plot.

It displays either an array of data using a colormap or a RGB(A) image.

Images are uniquely identified by their legend. To add multiple images, call addImage() multiple times with different legend argument. To replace/update an existing image, call addImage() with the existing image legend.

When image parameters are not provided, if an image with the same legend is displayed in the plot, its parameters are used.

Parameters:
  • data (numpy.ndarray) – (nrows, ncolumns) data or (nrows, ncolumns, RGBA) ubyte array Note: boolean values are converted to int8.

  • legend (str) – The legend to be associated to the image (or None)

  • info – User-defined information associated to the image

  • replace (bool) – True to delete already existing images (Default: False).

  • z (int) – Layer on which to draw the image (default: 0) This allows to control the overlay.

  • selectable (bool) – Indicate if the image can be selected. (default: False)

  • draggable (bool) – Indicate if the image can be moved. (default: False)

  • colormap (Union[Colormap, dict]) – Colormap object to use (or None). This is ignored if data is a RGB(A) image.

  • pixmap ((nrows, ncolumns, RGBA) ubyte array or None (default)) – Pixmap representation of the data (if any)

  • xlabel (str) – X axis label to show when this curve is active, or None to keep default axis label.

  • ylabel (str) – Y axis label to show when this curve is active, or None to keep default axis label.

  • origin (float or 2-tuple of float) – (origin X, origin Y) of the data. It is possible to pass a single float if both coordinates are equal. Default: (0., 0.)

  • scale (float or 2-tuple of float) – (scale X, scale Y) of the data. It is possible to pass a single float if both coordinates are equal. Default: (1., 1.)

  • resetzoom (bool) – True (the default) to reset the zoom.

  • copy (bool) – True make a copy of the data (default), False to use provided arrays.

Returns:

The image item

addItem(item)#

Add an item to the plot content.

Parameters:

item (Item) – The item to add.

Raises:

ValueError – If item is already in the plot.

addMarker(x, y, legend=None, text=None, color=None, selectable=False, draggable=False, symbol='+', constraint=None, yaxis='left')#

Add a point marker to the plot.

Markers are uniquely identified by their legend. As opposed to curves, images and items, two calls to addMarker() without legend argument adds two markers with different identifying legends.

Parameters:
  • x (float) – Position of the marker on the X axis in data coordinates

  • y (float) – Position of the marker on the Y axis in data coordinates

  • legend (str) – Legend associated to the marker to identify it

  • text (str) – Text to display next to the marker

  • color (str) – Color of the marker, e.g., ‘blue’, ‘b’, ‘#FF0000’ (Default: ‘black’)

  • selectable (bool) – Indicate if the marker can be selected. (default: False)

  • draggable (bool) – Indicate if the marker can be moved. (default: False)

  • symbol (str) –

    Symbol representing the marker in:

    - 'o' circle
    - '.' point
    - ',' pixel
    - '+' cross (the default)
    - 'x' x-cross
    - 'd' diamond
    - 's' square
    

  • constraint (None or a callable that takes the coordinates of the current cursor position in the plot as input and that returns the filtered coordinates.) – A function filtering marker displacement by dragging operations or None for no filter. This function is called each time a marker is moved. This parameter is only used if draggable is True.

  • yaxis (str) – The Y axis this marker belongs to in: ‘left’, ‘right’

Returns:

The marker item

addScatter(x, y, value, legend=None, colormap=None, info=None, symbol=None, xerror=None, yerror=None, z=None, copy=True)#

Add a (x, y, value) scatter to the graph.

Scatters are uniquely identified by their legend. To add multiple scatters, call addScatter() multiple times with different legend argument. To replace/update an existing scatter, call addScatter() with the existing scatter legend.

When scatter parameters are not provided, if a scatter with the same legend is displayed in the plot, its parameters are used.

Parameters:
  • x (numpy.ndarray) – The data corresponding to the x coordinates.

  • y (numpy.ndarray) – The data corresponding to the y coordinates

  • value (numpy.ndarray) – The data value associated with each point

  • legend (str) – The legend to be associated to the scatter (or None)

  • colormap (Colormap) – Colormap object to be used for the scatter (or None)

  • info – User-defined information associated to the curve

  • symbol (str) –

    Symbol to be drawn at each (x, y) position:

    - 'o' circle
    - '.' point
    - ',' pixel
    - '+' cross
    - 'x' x-cross
    - 'd' diamond
    - 's' square
    - None (the default) to use default symbol
    

  • xerror (A float, or a numpy.ndarray of float32. If it is an array, it can either be a 1D array of same length as the data or a 2D array with 2 rows of same length as the data: row 0 for lower errors, row 1 for upper errors.) – Values with the uncertainties on the x values

  • yerror (A float, or a numpy.ndarray of float32. See xerror.) – Values with the uncertainties on the y values

  • z (int) – Layer on which to draw the scatter (default: 1) This allows to control the overlay.

  • copy (bool) – True make a copy of the data (default), False to use provided arrays.

Returns:

The scatter item

addShape(xdata, ydata, legend=None, info=None, replace=False, shape='polygon', color='black', fill=True, overlay=False, z=None, linestyle='-', linewidth=1.0, linebgcolor='deprecated', gapcolor=None)#

Add an item (i.e. a shape) to the plot.

Items are uniquely identified by their legend. To add multiple items, call addItem() multiple times with different legend argument. To replace/update an existing item, call addItem() with the existing item legend.

Parameters:
  • xdata (numpy.ndarray) – The X coords of the points of the shape

  • ydata (numpy.ndarray) – The Y coords of the points of the shape

  • legend (str) – The legend to be associated to the item

  • info – User-defined information associated to the item

  • replace (bool) – True to delete already existing items (the default is False)

  • shape (str) – Type of item to be drawn in hline, polygon (the default), rectangle, vline, polylines

  • color (str) – Color of the item, e.g., ‘blue’, ‘b’, ‘#FF0000’ (Default: ‘black’)

  • fill (bool) – True (the default) to fill the shape

  • overlay (bool) – True if item is an overlay (Default: False). This allows for rendering optimization if this item is changed often.

  • z (int) – Layer on which to draw the item (default: 2)

  • linestyle (str) –

    Style of the line. Only relevant for line markers where X or Y is None. Value in:

    • ’ ‘ no line

    • ’-’ solid line

    • ’–’ dashed line

    • ’-.’ dash-dot line

    • ’:’ dotted line

  • linewidth (float) – Width of the line. Only relevant for line markers where X or Y is None.

  • gapcolor (str) – Gap color of the line, e.g., ‘blue’, ‘b’, ‘#FF0000’. It is used to draw dotted line using a second color.

Returns:

The shape item

addTabbedDockWidget(dock_widget)#

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: if 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.

addToolBar(self, area: Qt.ToolBarArea, toolbar: QToolBar | None)#
addToolBar(self, toolbar: QToolBar | None) None
addToolBar(self, title: str | None) QToolBar | None
addToolBarBreak(self, area: Qt.ToolBarArea = Qt.TopToolBarArea)#
addXMarker(x, legend=None, text=None, color=None, selectable=False, draggable=False, constraint=None, yaxis='left')#

Add a vertical line marker to the plot.

Markers are uniquely identified by their legend. As opposed to curves, images and items, two calls to addXMarker() without legend argument adds two markers with different identifying legends.

Parameters:
  • x (Union[None, float]) – Position of the marker on the X axis in data coordinates

  • legend (str) – Legend associated to the marker to identify it

  • text (str) – Text to display on the marker.

  • color (str) – Color of the marker, e.g., ‘blue’, ‘b’, ‘#FF0000’ (Default: ‘black’)

  • selectable (bool) – Indicate if the marker can be selected. (default: False)

  • draggable (bool) – Indicate if the marker can be moved. (default: False)

  • constraint (None or a callable that takes the coordinates of the current cursor position in the plot as input and that returns the filtered coordinates.) – A function filtering marker displacement by dragging operations or None for no filter. This function is called each time a marker is moved. This parameter is only used if draggable is True.

  • yaxis (str) – The Y axis this marker belongs to in: ‘left’, ‘right’

Returns:

The marker item

addYMarker(y, legend=None, text=None, color=None, selectable=False, draggable=False, constraint=None, yaxis='left')#

Add a horizontal line marker to the plot.

Markers are uniquely identified by their legend. As opposed to curves, images and items, two calls to addYMarker() without legend argument adds two markers with different identifying legends.

Parameters:
  • y (float) – Position of the marker on the Y axis in data coordinates

  • legend (str) – Legend associated to the marker to identify it

  • text (str) – Text to display next to the marker.

  • color (str) – Color of the marker, e.g., ‘blue’, ‘b’, ‘#FF0000’ (Default: ‘black’)

  • selectable (bool) – Indicate if the marker can be selected. (default: False)

  • draggable (bool) – Indicate if the marker can be moved. (default: False)

  • constraint (None or a callable that takes the coordinates of the current cursor position in the plot as input and that returns the filtered coordinates.) – A function filtering marker displacement by dragging operations or None for no filter. This function is called each time a marker is moved. This parameter is only used if draggable is True.

  • yaxis (str) – The Y axis this marker belongs to in: ‘left’, ‘right’

Returns:

The marker item

adjustSize(self)#
autoFillBackground(self) bool#
backgroundColor#

Returns the RGBA colors used to display the background of this widget.

Return type:

qt.QColor

backgroundRole(self) QPalette.ColorRole#
baseSize(self) QSize#
blockSignals(self, b: bool) bool#
centralWidget(self) QWidget | None#
changeEvent(self, a0: QEvent | None)#
childAt(self, p: QPoint) QWidget | None#
childAt(self, ax: int, ay: int) QWidget | None
childEvent(self, a0: QChildEvent | None)#
children(self) List[QObject]#
childrenRect(self) QRect#
childrenRegion(self) QRegion#
clear()#

Remove everything from the plot.

clearCurves()#

Remove all the curves from the plot.

clearFocus(self)#
clearImages()#

Remove all the images from the plot.

clearItems()#

Remove all the items from the plot.

clearMarkers()#

Remove all the markers from the plot.

clearMask(self)#
close(self) bool#
closeEvent(self, a0: QCloseEvent | None)#
colorCount(self) int#
colorDict = {'b': '#0000ff', 'black': '#000000', 'blue': '#0000ff', 'brown': '#a52a2a', 'c': '#00ffff', 'cyan': '#00ffff', 'darkBlue': '#000080', 'darkBrown': '#660000', 'darkCyan': '#008080', 'darkGreen': '#008000', 'darkMagenta': '#800080', 'darkRed': '#800000', 'darkYellow': '#808000', 'g': '#00ff00', 'gray': '#a0a0a4', 'green': '#00ff00', 'grey': '#a0a0a4', 'k': '#000000', 'm': '#ff00ff', 'magenta': '#ff00ff', 'orange': '#ff9900', 'pink': '#ff66ff', 'r': '#ff0000', 'red': '#ff0000', 'transparent': '#00000000', 'violet': '#6600ff', 'w': '#ffffff', 'white': '#ffffff', 'y': '#ffff00', 'yellow': '#ffff00'}#
colorList = ['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b', '#e377c2', '#7f7f7f', '#bcbd22', '#17becf']#
connectNotify(self, signal: QMetaMethod)#
contentsMargins(self) QMargins#
contentsRect(self) QRect#
contextMenuEvent(event)#

Override QWidget.contextMenuEvent to implement the context menu

contextMenuPolicy(self) Qt.ContextMenuPolicy#
corner(self, corner: Qt.Corner) Qt.DockWidgetArea#
create(self, window: PyQt5.sip.voidptr = None, initializeWindow: bool = True, destroyOldWindow: bool = True)#
createPopupMenu(self) QMenu | None#
createWindowContainer(window: QWindow | None, parent: QWidget | None = None, flags: Qt.WindowFlags | Qt.WindowType = 0) QWidget#
cursor(self) QCursor#
customContextMenuRequested#

customContextMenuRequested(self, pos: QPoint) [signal]

customEvent(self, a0: QEvent | None)#
dataBackgroundColor#

Returns the RGBA colors used to display the background of the plot view displaying the data.

An invalid QColor is returned if there is no data background color.

Return type:

qt.QColor

dataToPixel(x=None, y=None, axis='left', check=True)#

Convert a position in data coordinates to a position in pixels.

Parameters:
  • x (float or 1D numpy array of float) – The X coordinate in data space. If None (default) the middle position of the displayed data is used.

  • y (float or 1D numpy array of float) – The Y coordinate in data space. If None (default) the middle position of the displayed data is used.

  • axis (str) – The Y axis to use for the conversion (‘left’ or ‘right’).

  • check (bool) – True to return None if outside displayed area, False to convert to pixels anyway

Returns:

The corresponding position in pixels or None if the data position is not in the displayed area and check is True.

Return type:

A tuple of 2 floats or 2 arrays of float: (xPixel, yPixel) or None.

deleteLater(self)#
depth(self) int#
destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)#
destroyed#

destroyed(self, object: Optional[QObject] = None) [signal]

devType(self) int#
devicePixelRatio(self) int#
devicePixelRatioF(self) float#
devicePixelRatioFScale() float#
discardItem(item)#

Remove the item from the plot.

Same as removeItem() but do not raise an exception.

Parameters:

item (Item) – Item to remove from the plot.

Return type:

bool

Returns:

True if the item was present, False otherwise.

disconnect(a0: QMetaObject.Connection) bool#
disconnect(self) None
disconnectNotify(self, signal: QMetaMethod)#
dockOptions(self) QMainWindow.DockOptions#
dockWidgetArea(self, dockwidget: QDockWidget | None) Qt.DockWidgetArea#
documentMode(self) bool#
dragEnterEvent(self, a0: QDragEnterEvent | None)#
dragLeaveEvent(self, a0: QDragLeaveEvent | None)#
dragMoveEvent(self, a0: QDragMoveEvent | None)#
dropEvent(self, a0: QDropEvent | None)#
dumpObjectInfo(self)#
dumpObjectTree(self)#
dynamicPropertyNames(self) List[QByteArray]#
effectiveWinId(self) PyQt5.sip.voidptr#
ensurePolished(self)#
enterEvent(self, a0: QEvent | None)#
event(self, event: QEvent | None) bool#
eventFilter(self, a0: QObject | None, a1: QEvent | None) bool#
find(a0: PyQt5.sip.voidptr) QWidget | None#
findChild(self, type: Type[QObjectT], name: str | None = '', options: Qt.FindChildOptions | Qt.FindChildOption = Qt.FindChildrenRecursively) QObjectT#
findChild(self, types: Tuple[Type[QObjectT], ...], name: str | None = '', options: Qt.FindChildOptions | Qt.FindChildOption = Qt.FindChildrenRecursively) QObjectT
findChildren(self, type: Type[QObjectT], name: str | None = '', options: Qt.FindChildOptions | Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObjectT]#
findChildren(self, types: Tuple[Type[QObjectT], ...], name: str | None = '', options: Qt.FindChildOptions | Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObjectT]
findChildren(self, type: Type[QObjectT], regExp: QRegExp, options: Qt.FindChildOptions | Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObjectT]
findChildren(self, types: Tuple[Type[QObjectT], ...], regExp: QRegExp, options: Qt.FindChildOptions | Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObjectT]
findChildren(self, type: Type[QObjectT], re: QRegularExpression, options: Qt.FindChildOptions | Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObjectT]
findChildren(self, types: Tuple[Type[QObjectT], ...], re: QRegularExpression, options: Qt.FindChildOptions | Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObjectT]
focusInEvent(self, a0: QFocusEvent | None)#
focusNextChild(self) bool#
focusNextPrevChild(self, next: bool) bool#
focusOutEvent(self, a0: QFocusEvent | None)#
focusPolicy(self) Qt.FocusPolicy#
focusPreviousChild(self) bool#
focusProxy(self) QWidget | None#
focusWidget(self) QWidget | None#
font(self) QFont#
fontInfo(self) QFontInfo#
fontMetrics(self) QFontMetrics#
foregroundColor#

Returns the RGBA colors used to display the foreground of this widget

Return type:

qt.QColor

foregroundRole(self) QPalette.ColorRole#
frameGeometry(self) QRect#
frameSize(self) QSize#
geometry(self) QRect#
getActiveCurve(just_legend=False)#

Return the currently active curve.

It returns None in case of not having an active curve.

Parameters:

just_legend (bool) – True to get the legend of the curve, False (the default) to get the curve data and info.

Returns:

Active curve’s legend or corresponding items.Curve

Return type:

str or items.Curve or None

getActiveCurveSelectionMode()#

Returns the current selection mode.

It can be “atmostone”, “legacy” or “none”.

Return type:

str

getActiveCurveStyle()#

Returns the current style applied to active curve

Return type:

CurveStyle

getActiveImage(just_legend=False)#

Returns the currently active image.

It returns None in case of not having an active image.

Parameters:

just_legend (bool) – True to get the legend of the image, False (the default) to get the image data and info.

Returns:

Active image’s legend or corresponding image object

Return type:

str, items.ImageData, items.ImageRgba or None

getActiveScatter(just_legend=False)#

Returns the currently active scatter.

It returns None in case of not having an active scatter.

Parameters:

just_legend (bool) – True to get the legend of the scatter, False (the default) to get the scatter data and info.

Returns:

Active scatter’s legend or corresponding scatter object

Return type:

str, items.Scatter or None

getAllCurves(just_legend=False, withhidden=False)#

Returns all curves legend or info and data.

It returns an empty list in case of not having any curve.

If just_legend is False, it returns a list of items.Curve objects describing the curves. If just_legend is True, it returns a list of curves’ legend.

Parameters:
  • just_legend (bool) – True to get the legend of the curves, False (the default) to get the curves’ data and info.

  • withhidden (bool) – False (default) to skip hidden curves.

Returns:

list of curves’ legend or items.Curve

Return type:

list of str or list of items.Curve

getAllImages(just_legend=False)#

Returns all images legend or objects.

It returns an empty list in case of not having any image.

If just_legend is False, it returns a list of items.ImageBase objects describing the images. If just_legend is True, it returns a list of legends.

Parameters:

just_legend (bool) – True to get the legend of the images, False (the default) to get the images’ object.

Returns:

list of images’ legend or items.ImageBase

Return type:

list of str or list of items.ImageBase

getAutoReplot()#

Return True if replot is automatically handled, False otherwise.

See :meth`setAutoReplot`.

getAxesMargins()#

Returns ratio of margins surrounding data plot area.

Returns:

(left, top, right, bottom)

Return type:

List[float]

getBackend()#

Returns the backend currently used by PlotWidget.

Return type:

BackendBase

getBackgroundColor()#

Returns the RGBA colors used to display the background of this widget.

Return type:

qt.QColor

getColorBarAction()#

Action toggling the colorbar show/hide action

Warning

to show/hide the plot colorbar call directly the ColorBar widget using getColorBarWidget()

Return type:

actions.PlotAction

getColorBarWidget()#

Returns the embedded ColorBarWidget widget.

Return type:

ColorBarWidget

getColormapAction()#

Action open a colormap dialog to change active image and default colormap.

Return type:

actions.PlotAction

getConsoleAction()#

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.

Return type:

QAction

getContentsMargins()#
getCopyAction()#

Action to copy plot snapshot to clipboard

Return type:

actions.PlotAction

getCrosshairAction()#

Action toggling crosshair cursor mode.

Return type:

actions.PlotAction

getCurve(legend=None)#

Get the object describing a specific curve.

It returns None in case no matching curve is found.

Parameters:

legend (str | items.Curve | None) – The legend identifying the curve. If not provided or None (the default), the active curve is returned or if there is no active curve, the latest updated curve that is not hidden is returned if there are curves in the plot.

Return type:

items.Curve

Returns:

None or items.Curve object

getCurveStyleAction()#

Action to change curve line and markers styles

Return type:

actions.PlotAction

getCurvesRoiDockWidget()#
getCurvesRoiWidget()#

Return the CurvesROIWidget.

silx.gui.plot.CurvesROIWidget.CurvesROIWidget offers a getter and a setter for the ROI data:

  • CurvesROIWidget.getRois()

  • CurvesROIWidget.setRois()

getDataBackgroundColor()#

Returns the RGBA colors used to display the background of the plot view displaying the data.

An invalid QColor is returned if there is no data background color.

Return type:

qt.QColor

getDataMargins()#

Get the default data margin ratios, see setDataMargins().

Returns:

The margin ratios for each side (xMin, xMax, yMin, yMax).

getDataRange()#

Returns this PlotWidget’s data range.

Returns:

a namedtuple with the following members : x, y (left y axis), yright. Each member is a tuple (min, max) or None if no data is associated with the axis.

Return type:

namedtuple

getDefaultColormap()#

Return the default colormap used by addImage().

Return type:

Colormap

getDefaultColors()#

Returns the list of default colors for curves and histograms

Return type:

Tuple[str, …]

getFitAction()#

Action to fit selected curve

Return type:

actions.PlotAction

getForegroundColor()#

Returns the RGBA colors used to display the foreground of this widget

Return type:

qt.QColor

getGraphCursor()#

Returns the state of the crosshair cursor.

See setGraphCursor().

Returns:

None if the crosshair cursor is not active, else a tuple (color, linewidth, linestyle).

getGraphCursorShape()#

Returns the current cursor shape.

Return type:

str

getGraphGrid()#

Return the current grid mode, either None, ‘major’ or ‘both’.

See setGraphGrid().

getGraphTitle()#

Return the plot main title as a str.

getGraphXLabel()#

Return the current X axis label as a str.

getGraphXLimits()#

Get the graph X (bottom) limits.

Returns:

Minimum and maximum values of the X axis

getGraphYLabel(axis='left')#

Return the current Y axis label as a str.

Parameters:

axis (str) – The Y axis for which to get the label (left or right)

getGraphYLimits(axis='left')#

Get the graph Y limits.

Parameters:

axis (str) – The axis for which to get the limits: Either ‘left’ or ‘right’

Returns:

Minimum and maximum values of the X axis

getGridAction()#

Action to toggle the grid visibility in the plot

Return type:

actions.PlotAction

getGridColor()#

Returns the RGBA colors used to display the grid lines

An invalid QColor is returned if there is no grid color, in which case the foreground color is used.

Return type:

qt.QColor

getHistogram(legend=None)#

Get the object describing a specific histogram.

It returns None in case no matching histogram is found.

Parameters:

legend (str | items.Histogram | None) – The legend identifying the histogram. If not provided or None (the default), the latest updated scatter is returned if there are histograms in the plot.

Return type:

items.Histogram

Returns:

None or items.Histogram object

getImage(legend=None)#

Get the object describing a specific image.

It returns None in case no matching image is found.

Parameters:

legend (str | items.ImageBase | None) – The legend identifying the image. If not provided or None (the default), the active image is returned or if there is no active image, the latest updated image is returned if there are images in the plot.

Return type:

items.ImageBase

Returns:

None or items.ImageBase object

getIntensityHistogramAction()#

Action toggling the histogram intensity Plot widget

Return type:

actions.PlotAction

getInteractiveMode()#

Returns the current interactive mode as a dict.

The returned dict contains at least the key ‘mode’. Mode can be: ‘draw’, ‘pan’, ‘select’, ‘select-draw’, ‘zoom’. It can also contains extra keys (e.g., ‘color’) specific to a mode as provided to setInteractiveMode().

getInteractiveModeToolBar()#

Returns QToolBar controlling interactive mode.

Return type:

QToolBar

getItems()#

Returns the list of items in the plot

Return type:

List[silx.gui.plot.items.Item]

getKeepDataAspectRatioAction()#

Action associated to keepDataAspectRatioButton. Use this to change the visibility of keepDataAspectRatioButton in the toolbar (See QToolBar.addWidget() documentation).

Return type:

actions.PlotAction

getKeepDataAspectRatioButton()#

Button to toggle aspect ratio preservation

Return type:

PlotToolButtons.AspectToolButton

getLegendsDockWidget()#

DockWidget with Legend panel

getLimitsHistory()#

Returns the object handling the history of limits of the plot

getMaskAction()#

QAction toggling image mask dock widget

Return type:

QAction

getMaskToolsDockWidget()#

DockWidget with image mask panel (lazy-loaded).

getMedianFilter1DAction()#

Action toggling the 1D median filter

Return type:

actions.PlotAction

getMedianFilter2DAction()#

Action toggling the 2D median filter

Return type:

actions.PlotAction

getOutputToolBar()#

Returns QToolBar containing save, copy and print actions

Return type:

QToolBar

getPanWithArrowKeysAction()#

Action toggling pan with arrow keys.

Return type:

actions.PlotAction

getPlotBoundsInPixels()#

Plot area bounds in widget coordinates in pixels.

Returns:

bounds as a 4-tuple of int: (left, top, width, height)

getPositionInfoWidget()#

Returns the widget displaying current cursor position information

Return type:

PositionInfo

getPrintAction()#

Action to print plot

Return type:

actions.PlotAction

getResetZoomAction()#

Action resetting the zoom

Return type:

actions.PlotAction

getRoiAction()#

QAction toggling curve ROI dock widget

Return type:

QAction

getSaveAction()#

Action to save plot

Return type:

actions.PlotAction

getScatter(legend=None)#

Get the object describing a specific scatter.

It returns None in case no matching scatter is found.

Parameters:

legend (str | items.Scatter | None) – The legend identifying the scatter. If not provided or None (the default), the active scatter is returned or if there is no active scatter, the latest updated scatter is returned if there are scatters in the plot.

Return type:

items.Scatter

Returns:

None or items.Scatter object

getSelectionMask()#

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

getStatsAction()#
getStatsWidget()#

Returns a BasicStatsWidget connected to this plot

Return type:

BasicStatsWidget

static getSupportedColormaps()#

Get the supported colormap names as a tuple of str.

The list contains at least: (‘gray’, ‘reversed gray’, ‘temperature’, ‘red’, ‘green’, ‘blue’, ‘magma’, ‘inferno’, ‘plasma’, ‘viridis’)

getWidgetHandle()#

Return the widget the plot is displayed in.

This widget is owned by the backend.

getXAxis()#

Returns the X axis

New in version 0.6.

Return type:

items.Axis

getXAxisAutoScaleAction()#

Action to toggle the X axis autoscale on zoom reset

Return type:

actions.PlotAction

getXAxisLogarithmicAction()#

Action to toggle logarithmic X axis

Return type:

actions.PlotAction

getYAxis(axis='left')#

Returns an Y axis

New in version 0.6.

Parameters:

axis (str) – The Y axis to return (‘left’ or ‘right’).

Return type:

items.Axis

getYAxisAutoScaleAction()#

Action to toggle the Y axis autoscale on zoom reset

Return type:

actions.PlotAction

getYAxisInvertedAction()#

Action associated to yAxisInvertedButton. Use this to change the visibility yAxisInvertedButton in the toolbar. (See QToolBar.addWidget() documentation).

Return type:

actions.PlotAction

getYAxisInvertedButton()#

Button to switch the Y axis orientation

Return type:

PlotToolButtons.YAxisOriginToolButton

getYAxisLogarithmicAction()#

Action to toggle logarithmic Y axis

Return type:

actions.PlotAction

getZoomInAction()#

Action to zoom in

Return type:

actions.PlotAction

getZoomOutAction()#

Action to zoom out

Return type:

actions.PlotAction

grab(self, rectangle: QRect = QRect(QPoint(0, 0), QSize(-1, -1))) QPixmap#
grabGesture(self, type: Qt.GestureType, flags: Qt.GestureFlags | Qt.GestureFlag = Qt.GestureFlags())#
grabKeyboard(self)#
grabMouse(self)#
grabMouse(self, a0: QCursor | Qt.CursorShape) None
grabShortcut(self, key: QKeySequence | QKeySequence.StandardKey | str | None | int, context: Qt.ShortcutContext = Qt.WindowShortcut) int#
graphCallback(ddict=None)#

This callback is going to receive all the events from the plot.

Those events will consist on a dictionary and among the dictionary keys the key ‘event’ is mandatory to describe the type of event. This default implementation only handles setting the active curve.

graphicsEffect(self) QGraphicsEffect | None#
graphicsProxyWidget(self) QGraphicsProxyWidget | None#
gridColor#

Returns the RGBA colors used to display the grid lines

An invalid QColor is returned if there is no grid color, in which case the foreground color is used.

Return type:

qt.QColor

hasFocus(self) bool#
hasHeightForWidth(self) bool#
hasMouseTracking(self) bool#
hasTabletTracking(self) bool#
height(self) int#
heightForWidth(self, a0: int) int#
heightMM(self) int#
hide(self)#
hideCurve(legend, flag=True)#

Show/Hide the curve associated to legend.

Even when hidden, the curve is kept in the list of curves.

Parameters:
  • legend (str) – The legend associated to the curve to be hidden

  • flag (bool) – True (default) to hide the curve, False to show it

hideEvent(self, a0: QHideEvent | None)#
iconSize(self) QSize#
iconSizeChanged#

iconSizeChanged(self, iconSize: QSize) [signal]

inherits(self, classname: str | None) bool#
initPainter(self, painter: QPainter | None)#
inputMethodEvent(self, a0: QInputMethodEvent | None)#
inputMethodHints(self) Qt.InputMethodHints#
inputMethodQuery(self, a0: Qt.InputMethodQuery) Any#
insertAction(self, before: QAction | None, action: QAction | None)#
insertActions(self, before: QAction | None, actions: Iterable[QAction])#
insertToolBar(self, before: QToolBar | None, toolbar: QToolBar | None)#
insertToolBarBreak(self, before: QToolBar | None)#
installEventFilter(self, a0: QObject | None)#
interaction()#

Returns the interaction handler for this PlotWidget

isActiveCurveHandling()#

Returns True if active curve selection is enabled.

Return type:

bool

isActiveWindow(self) bool#
isAncestorOf(self, child: QWidget | None) bool#
isAnimated(self) bool#
isAxesDisplayed()#

Returns whether or not axes are currently displayed

Return type:

bool

isCurveHidden(legend)#

Returns True if the curve associated to legend is hidden, else False

Parameters:

legend (str) – The legend key identifying the curve

Returns:

True if the associated curve is hidden, False otherwise

isDefaultPlotLines()#

Return True for line as default line style, False for no line.

isDefaultPlotPoints()#

Return True if the default Curve symbol is set and False if not.

isDockNestingEnabled(self) bool#
isEnabled(self) bool#
isEnabledTo(self, a0: QWidget | None) bool#
isFullScreen(self) bool#
isHidden(self) bool#
isKeepDataAspectRatio()#

Returns whether the plot is keeping data aspect ratio or not.

isLeftToRight(self) bool#
isMaximized(self) bool#
isMinimized(self) bool#
isModal(self) bool#
isPanWithArrowKeys()#

Returns whether or not panning the graph with arrow keys is enabled.

See setPanWithArrowKeys().

isRightToLeft(self) bool#
isSeparator(self, pos: QPoint) bool#
isSignalConnected(self, signal: QMetaMethod) bool#
isVisible(self) bool#
isVisibleTo(self, a0: QWidget | None) bool#
isWidgetType(self) bool#
isWindow(self) bool#
isWindowModified(self) bool#
isWindowType(self) bool#
isXAxisAutoScale()#

Return True if X axis is automatically adjusting its limits.

isXAxisLogarithmic()#

Return True if X axis scale is logarithmic, False if linear.

isYAxisAutoScale()#

Return True if Y axes are automatically adjusting its limits.

isYAxisInverted()#

Return True if Y axis goes from top to bottom, False otherwise.

isYAxisLogarithmic()#

Return True if Y axis scale is logarithmic, False if linear.

keyPressEvent(event)#

Key event handler handling panning on arrow keys.

Overrides base class implementation.

keyReleaseEvent(self, a0: QKeyEvent | None)#
keyboardGrabber() QWidget | None#
killTimer(self, id: int)#
layout(self) QLayout | None#
layoutDirection(self) Qt.LayoutDirection#
leaveEvent(self, a0: QEvent | None)#
locale(self) QLocale#
logicalDpiX(self) int#
logicalDpiY(self) int#
lower(self)#
mapFrom(self, a0: QWidget | None, a1: QPoint) QPoint#
mapFromGlobal(self, a0: QPoint) QPoint#
mapFromParent(self, a0: QPoint) QPoint#
mapTo(self, a0: QWidget | None, a1: QPoint) QPoint#
mapToGlobal(self, a0: QPoint) QPoint#
mapToParent(self, a0: QPoint) QPoint#
mask(self) QRegion#
maximumHeight(self) int#
maximumSize(self) QSize#
maximumWidth(self) int#
menu(title='Plot', parent=None)#

Return a QMenu from the QAction of the PlotWindow.

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

  • parent – See QMenu

menuBar(self) QMenuBar | None#
menuWidget(self) QWidget | None#
metaObject(self) QMetaObject | None#
metric(self, a0: QPaintDevice.PaintDeviceMetric) int#
minimumHeight(self) int#
minimumSize(self) QSize#
minimumSizeHint(self) QSize#
minimumWidth(self) int#
mouseDoubleClickEvent(self, a0: QMouseEvent | None)#
mouseGrabber() QWidget | None#
mouseMoveEvent(self, a0: QMouseEvent | None)#
mousePressEvent(self, a0: QMouseEvent | None)#
mouseReleaseEvent(self, a0: QMouseEvent | None)#
move(self, a0: QPoint)#
move(self, ax: int, ay: int) None
moveEvent(self, a0: QMoveEvent | None)#
moveToThread(self, thread: QThread | None)#
nativeEvent(self, eventType: QByteArray | bytes | bytearray, message: PyQt5.sip.voidptr | None)#
nativeParentWidget(self) QWidget | None#
nextInFocusChain(self) QWidget | None#
normalGeometry(self) QRect#
notify(event, **kwargs)#

Send an event to the listeners and send signals.

Event are passed to the registered callback as a dict with an ‘event’ key for backward compatibility with PyMca.

Parameters:
  • event (str) – The type of event

  • kwargs – The information of the event.

objectName(self) str#
objectNameChanged#

objectNameChanged(self, objectName: Optional[str]) [signal]

onMouseLeaveWidget()#

Handle mouse leave widget event.

onMouseMove(xPixel, yPixel)#

Handle mouse move event.

Parameters:
  • xPixel (float) – X mouse position in pixels

  • yPixel (float) – Y mouse position in pixels

onMousePress(xPixel, yPixel, btn)#

Handle mouse press event.

Parameters:
  • xPixel (float) – X mouse position in pixels

  • yPixel (float) – Y mouse position in pixels

  • btn (str) – Mouse button in ‘left’, ‘middle’, ‘right’

onMouseRelease(xPixel, yPixel, btn)#

Handle mouse release event.

Parameters:
  • xPixel (float) – X mouse position in pixels

  • yPixel (float) – Y mouse position in pixels

  • btn (str) – Mouse button in ‘left’, ‘middle’, ‘right’

onMouseWheel(xPixel, yPixel, angleInDegrees)#

Handle mouse wheel event.

Parameters:
  • xPixel (float) – X mouse position in pixels

  • yPixel (float) – Y mouse position in pixels

  • angleInDegrees (float) – Angle corresponding to wheel motion. Positive for movement away from the user, negative for movement toward the user.

overrideWindowFlags(self, type: Qt.WindowFlags | Qt.WindowType)#
overrideWindowState(self, state: Qt.WindowStates | Qt.WindowState)#
paintEngine(self) QPaintEngine | None#
paintEvent(self, a0: QPaintEvent | None)#
paintingActive(self) bool#
palette(self) QPalette#
pan(direction, factor=0.1)#

Pan the graph in the given direction by the given factor.

Warning: Pan of right Y axis not implemented!

Parameters:
  • direction (str) – One of ‘up’, ‘down’, ‘left’, ‘right’.

  • factor (float) – Proportion of the range used to pan the graph. Must be strictly positive.

parent(self) QObject | None#
parentWidget(self) QWidget | None#
physicalDpiX(self) int#
physicalDpiY(self) int#
pickItems(x, y, condition=None)#

Generator of picked items in the plot at given position.

Items are returned from front to back.

Parameters:
  • x (float) – X position in pixels

  • y (float) – Y position in pixels

  • condition (callable) – Callable taking an item as input and returning False for items to skip during picking. If None (default) no item is skipped.

Returns:

Iterable of PickingResult objects at picked position. Items are ordered from front to back.

pixelToData(x, y, axis='left', check=False)#

Convert a position in pixels to a position in data coordinates.

Parameters:
  • x (float) – The X coordinate in pixels. If None (default) the center of the widget is used.

  • y (float) – The Y coordinate in pixels. If None (default) the center of the widget is used.

  • axis (str) – The Y axis to use for the conversion (‘left’ or ‘right’).

  • check (bool) – Toggle checking if pixel is in plot area. If False, this method never returns None.

Returns:

The corresponding position in data space or None if the pixel position is not in the plot area.

Return type:

A tuple of 2 floats: (xData, yData) or None.

pos(self) QPoint#
previousInFocusChain(self) QWidget | None#
property(self, name: str | None) Any#
pyqtConfigure(...)#

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

raise_(self)#
receivers(self, signal: PYQT_SIGNAL) int#
rect(self) QRect#
releaseKeyboard(self)#
releaseMouse(self)#
releaseShortcut(self, id: int)#
remove(legend=None, kind=('curve', 'image', 'scatter', 'item', 'marker', 'histogram'))#

Remove one or all element(s) of the given legend and kind.

Examples:

  • remove() clears the plot

  • remove(kind='curve') removes all curves from the plot

  • remove('myCurve', kind='curve') removes the curve with legend ‘myCurve’ from the plot.

  • remove('myImage, kind='image') removes the image with legend ‘myImage’ from the plot.

  • remove('myImage') removes elements (for instance curve, image, item and marker) with legend ‘myImage’.

Parameters:
  • legend (str | items.Item | None) – The legend of the item to remove or the item itself. If None all items of given kind are removed.

  • kind (str | Sequence[str]) – The kind of items to remove from the plot. See ITEM_KINDS. By default, it removes all kind of elements.

removeAction(self, action: QAction | None)#
removeCurve(legend)#

Remove the curve associated to legend from the graph.

Parameters:

legend (str | items.Curve | None) – The legend of the curve to be deleted or the curve item

removeDockWidget(dockwidget)#

Removes the dockwidget from the main window layout and hides it.

Note that the dockwidget is not deleted.

Parameters:

dockwidget (QDockWidget) –

removeEventFilter(self, a0: QObject | None)#
removeImage(legend)#

Remove the image associated to legend from the graph.

Parameters:

legend (str | items.ImageBase | None) – The legend of the image to be deleted or the image item

removeItem(item)#

Remove the item from the plot.

Parameters:

item (Item) – Item to remove from the plot.

Raises:

ValueError – If item is not in the plot.

removeMarker(legend)#

Remove the marker associated to legend from the graph.

Parameters:

legend (str | items.Marker | None) – The legend of the marker to be deleted or the marker item

removeToolBar(self, toolbar: QToolBar | None)#
removeToolBarBreak(self, before: QToolBar | None)#
render(self, target: QPaintDevice | None, targetOffset: QPoint = QPoint(), sourceRegion: QRegion = QRegion(), flags: QWidget.RenderFlags | QWidget.RenderFlag = QWidget.RenderFlags(QWidget.RenderFlag.DrawWindowBackground | QWidget.RenderFlag.DrawChildren))#
render(self, painter: QPainter | None, targetOffset: QPoint = QPoint(), sourceRegion: QRegion = QRegion(), flags: QWidget.RenderFlags | QWidget.RenderFlag = QWidget.RenderFlags(QWidget.RenderFlag.DrawWindowBackground | QWidget.RenderFlag.DrawChildren)) None
repaint(self)#
repaint(self, x: int, y: int, w: int, h: int) None
repaint(self, a0: QRect) None
repaint(self, a0: QRegion) None
replot()#

Request to draw the plot.

resetInteractiveMode()#

Reset the interactive mode to use the previous basic interactive mode used.

It can be one of “zoom” or “pan”.

resetZoom(dataMargins=None)#

Reset the plot limits to the bounds of the data and redraw the plot.

It automatically scale limits of axes that are in autoscale mode (see getXAxis(), getYAxis() and Axis.setAutoScale()). It keeps current limits on axes that are not in autoscale mode.

Extra margins can be added around the data inside the plot area (see setDataMargins()). Margins are given as one ratio of the data range per limit of the data (xMin, xMax, yMin and yMax limits). For log scale, extra margins are applied in log10 of the data.

Parameters:

dataMargins (A 4-tuple of float as (xMin, xMax, yMin, yMax).) – Ratios of margins to add around the data inside the plot area for each side (default: no margins).

resize(self, a0: QSize)#
resize(self, w: int, h: int) None
resizeDocks(self, docks: Iterable[QDockWidget], sizes: Iterable[int], orientation: Qt.Orientation)#
resizeEvent(self, a0: QResizeEvent | None)#
restoreDockWidget(self, dockwidget: QDockWidget | None) bool#
restoreGeometry(self, geometry: QByteArray | bytes | bytearray) bool#
restoreState(self, state: QByteArray | bytes | bytearray, version: int = 0) bool#
saveGeometry(self) QByteArray#
saveGraph(filename, fileFormat=None, dpi=None)#

Save a snapshot of the plot.

Supported file formats depends on the backend in use. The following file formats are always supported: “png”, “svg”. The matplotlib backend supports more formats: “pdf”, “ps”, “eps”, “tiff”, “jpeg”, “jpg”.

Parameters:
  • filename (str, StringIO or BytesIO) – Destination

  • fileFormat (str) – String specifying the format

Returns:

False if cannot save the plot, True otherwise

saveState(self, version: int = 0) QByteArray#
screen(self) QScreen | None#
scroll(self, dx: int, dy: int)#
scroll(self, dx: int, dy: int, a2: QRect) None
selection()#

Returns the selection hander

sender(self) QObject | None#
senderSignalIndex(self) int#
setAcceptDrops(self, on: bool)#
setAccessibleDescription(self, description: str | None)#
setAccessibleName(self, name: str | None)#
setActiveCurve(legend)#

Make the curve associated to legend the active curve.

Parameters:

legend (str or None) – The legend associated to the curve or None to have no active curve.

setActiveCurveHandling(flag=True)#

Enable/Disable active curve selection.

Parameters:

flag (bool) – True to enable ‘atmostone’ active curve selection, False to disable active curve selection.

setActiveCurveSelectionMode(mode)#

Sets the current selection mode.

Parameters:

mode (str) – The active curve selection mode to use. It can be: ‘legacy’, ‘atmostone’ or ‘none’.

setActiveCurveStyle(color=None, linewidth=None, linestyle=None, symbol=None, symbolsize=None)#

Set the style of active curve

Parameters:
  • color – Color

  • linestyle (Union[str,None]) – Style of the line

  • linewidth (Union[float,None]) – Width of the line

  • symbol (Union[str,None]) – Symbol of the markers

  • symbolsize (Union[float,None]) – Size of the symbols

setActiveImage(legend)#

Make the image associated to legend the active image.

Parameters:

legend (str) – The legend associated to the image or None to have no active image.

setActiveScatter(legend)#

Make the scatter associated to legend the active scatter.

Parameters:

legend (str) – The legend associated to the scatter or None to have no active scatter.

setAnimated(self, enabled: bool)#
setAttribute(self, attribute: Qt.WidgetAttribute, on: bool = True)#
setAutoFillBackground(self, enabled: bool)#
setAutoReplot(autoreplot=True)#

Set automatic replot mode.

When enabled, the plot is redrawn automatically when changed. When disabled, the plot is not redrawn when its content change. Instead, it replot() must be called.

Parameters:

autoreplot (bool) – True to enable it (default), False to disable it.

setAxesDisplayed(displayed)#

Display or not the axes.

Parameters:
  • displayed (bool) – If True axes are displayed. If False axes are not anymore visible and the margin used for them is removed.

  • displayed

setAxesMargins(left, top, right, bottom)#

Set ratios of margins surrounding data plot area.

All ratios must be within [0., 1.]. Sums of ratios of opposed side must be < 1.

Parameters:
  • left (float) – Left-side margin ratio.

  • top (float) – Top margin ratio

  • right (float) – Right-side margin ratio

  • bottom (float) – Bottom margin ratio

  • left

  • top

  • right

  • bottom

Raises:

ValueError

setBackend(backend)#

Set the backend to use for rendering.

Supported backends:

  • ‘matplotlib’ and ‘mpl’: Matplotlib with Qt.

  • ‘opengl’ and ‘gl’: OpenGL backend (requires PyOpenGL and OpenGL >= 2.1)

  • ‘none’: No backend, to run headless for testing purpose.

Parameters:

backend (Union[str,BackendBase,List[Union[str,BackendBase]]]) – The backend to use, in: ‘matplotlib’ (default), ‘mpl’, ‘opengl’, ‘gl’, ‘none’, a BackendBase.BackendBase class. If multiple backends are provided, the first available one is used.

Raises:
  • ValueError – Unsupported backend descriptor

  • RuntimeError – Error while loading a backend

setBackgroundColor(color)#

Set the background color of this widget.

Parameters:

color (Union[List[int],List[float],QColor]) – The new RGB(A) color.

setBackgroundRole(self, a0: QPalette.ColorRole)#
setBaseSize(self, basew: int, baseh: int)#
setBaseSize(self, s: QSize) None
setCallback(callbackFunction=None)#

Attach a listener to the backend.

Limitation: Only one listener at a time.

Parameters:

callbackFunction – function accepting a dictionary as input to handle the graph events If None (default), use a default listener.

setCentralWidget(self, widget: QWidget | None)#
setContentsMargins(self, left: int, top: int, right: int, bottom: int)#
setContentsMargins(self, margins: QMargins) None
setContextMenuPolicy(self, policy: Qt.ContextMenuPolicy)#
setCorner(self, corner: Qt.Corner, area: Qt.DockWidgetArea)#
setCursor(self, a0: QCursor | Qt.CursorShape)#
setData(vals, title=None)[source]#
Parameters:

vals (ndarray) –

setDataBackgroundColor(color)#

Set the background color of the plot area.

Set to None or an invalid QColor to use the background color.

Parameters:

color (Union[List[int],List[float],QColor,None]) – The new RGB(A) color.

setDataMargins(xMinMargin=0.0, xMaxMargin=0.0, yMinMargin=0.0, yMaxMargin=0.0)#

Set the default data margins to use in resetZoom().

Set the default ratios of margins to add around the data inside the plot area for each side.

Parameters:
  • xMinMargin (float) –

  • xMaxMargin (float) –

  • yMinMargin (float) –

  • yMaxMargin (float) –

setDefaultColormap(colormap=None)#

Set the default colormap used by addImage().

Setting the default colormap do not change any currently displayed image. It only affects future calls to addImage() without the colormap parameter.

Parameters:

colormap (Colormap) – The description of the default colormap, or None to set the colormap to a linear autoscale gray colormap.

setDefaultColors(colors)#

Set the list of colors to use as default for curves and histograms.

Set to None to use silx.config.DEFAULT_PLOT_CURVE_COLORS.

Parameters:

colors (Optional[Tuple[str, …]]) –

setDefaultPlotLines(flag)#

Toggle the use of lines as the default curve line style.

Parameters:

flag (bool) – True to use a line as the default line style, False to use no line as the default line style.

setDefaultPlotPoints(flag)#

Set the default symbol of all curves.

When called, this reset the symbol of all existing curves.

Parameters:

flag (bool) – True to use ‘o’ as the default curve symbol, False to use no symbol.

setDisabled(self, a0: bool)#
setDockNestingEnabled(self, enabled: bool)#
setDockOptions(self, options: QMainWindow.DockOptions | QMainWindow.DockOption)#
setDocumentMode(self, enabled: bool)#
setEnabled(self, a0: bool)#
setFixedHeight(self, h: int)#
setFixedSize(self, a0: QSize)#
setFixedSize(self, w: int, h: int) None
setFixedWidth(self, w: int)#
setFocus(self)#
setFocus(self, reason: Qt.FocusReason) None
setFocusPolicy(self, policy: Qt.FocusPolicy)#
setFocusProxy(self, a0: QWidget | None)#
setFont(self, a0: QFont)#
setForegroundColor(color)#

Set the foreground color of this widget.

Parameters:

color (Union[List[int],List[float],QColor]) – The new RGB(A) color.

setForegroundRole(self, a0: QPalette.ColorRole)#
setGeometry(self, a0: QRect)#
setGeometry(self, ax: int, ay: int, aw: int, ah: int) None
setGraphCursor(flag=False, color='black', linewidth=1, linestyle='-')#

Toggle the display of a crosshair cursor and set its attributes.

Parameters:
  • flag (bool) – Toggle the display of a crosshair cursor. The crosshair cursor is hidden by default.

  • color (A string (either a predefined color name in colors.py or "#RRGGBB")) or a 4 columns unsigned byte array (Default: black).) – The color to use for the crosshair.

  • linewidth (int) – The width of the lines of the crosshair (Default: 1).

  • linestyle (str) –

    Type of line:

    - ' ' no line
    - '-' solid line (the default)
    - '--' dashed line
    - '-.' dash-dot line
    - ':' dotted line
    

setGraphCursorShape(cursor=None)#

Set the cursor shape.

Parameters:

cursor (str) – Name of the cursor shape

setGraphGrid(which=True)#

Set the type of grid to display.

Parameters:

which (str of bool) – None or False to disable the grid, ‘major’ or True for grid on major ticks (the default), ‘both’ for grid on both major and minor ticks.

setGraphTitle(title='')#

Set the plot main title.

Parameters:

title (str) – Main title of the plot (default: ‘’)

setGraphXLabel(label='X')#

Set the plot X axis label.

The provided label can be temporarily replaced by the X label of the active curve if any.

Parameters:

label (str) – The X axis label (default: ‘X’)

setGraphXLimits(xmin, xmax)#

Set the graph X (bottom) limits.

Parameters:
  • xmin (float) – minimum bottom axis value

  • xmax (float) – maximum bottom axis value

setGraphYLabel(label='Y', axis='left')#

Set the plot Y axis label.

The provided label can be temporarily replaced by the Y label of the active curve if any.

Parameters:
  • label (str) – The Y axis label (default: ‘Y’)

  • axis (str) – The Y axis for which to set the label (left or right)

setGraphYLimits(ymin, ymax, axis='left')#

Set the graph Y limits.

Parameters:
  • ymin (float) – minimum bottom axis value

  • ymax (float) – maximum bottom axis value

  • axis (str) – The axis for which to get the limits: Either ‘left’ or ‘right’

setGraphicsEffect(self, effect: QGraphicsEffect | None)#
setGridColor(color)#

Set the grid lines color

Parameters:

color (Union[List[int],List[float],QColor,None]) – The new RGB(A) color.

setHidden(self, hidden: bool)#
setIconSize(self, iconSize: QSize)#
setInputMethodHints(self, hints: Qt.InputMethodHints | Qt.InputMethodHint)#
setInteractiveMode(mode, color='black', shape='polygon', label=None, zoomOnWheel=True, source=None, width=None)#

Switch the interactive mode.

Parameters:
  • mode – The name of the interactive mode. In ‘draw’, ‘pan’, ‘select’, ‘select-draw’, ‘zoom’.

  • color (Color description: The name as a str or a tuple of 4 floats.) – Only for ‘draw’ and ‘zoom’ modes. Color to use for drawing selection area. Default black.

  • shape – Only for ‘draw’ mode. The kind of shape to draw. In ‘polygon’, ‘rectangle’, ‘line’, ‘vline’, ‘hline’, ‘freeline’. Default is ‘polygon’.

  • label – Only for ‘draw’ mode, sent in drawing events.

  • zoomOnWheel – Toggle zoom on wheel support

  • source – A user-defined object (typically the caller object) that will be send in the interactiveModeChanged event, to identify which object required a mode change. Default: None

  • width – Width of the pencil. Only for draw pencil mode.

setKeepDataAspectRatio(flag=True)#

Set whether the plot keeps data aspect ratio or not.

Parameters:

flag (bool) – True to respect data aspect ratio

setLayout(self, a0: QLayout | None)#
setLayoutDirection(self, direction: Qt.LayoutDirection)#
setLimits(xmin, xmax, ymin, ymax, y2min=None, y2max=None, margins=False)#

Set the limits of the X and Y axes at once.

If y2min or y2max is None, the right Y axis limits are not updated.

Parameters:
  • xmin – minimum bottom axis value

  • xmax – maximum bottom axis value

  • ymin – minimum left axis value

  • ymax – maximum left axis value

  • y2min – minimum right axis value or None (the default)

  • y2max – maximum right axis value or None (the default)

  • margins – Data margins to add to the limits or a boolean telling whether or not to add margins from getDataMargins().

setLocale(self, locale: QLocale)#
setMask(self, a0: QBitmap)#
setMask(self, a0: QRegion) None
setMaximumHeight(self, maxh: int)#
setMaximumSize(self, maxw: int, maxh: int)#
setMaximumSize(self, s: QSize) None
setMaximumWidth(self, maxw: int)#
setMenuBar(self, menubar: QMenuBar | None)#
setMenuWidget(self, menubar: QWidget | None)#
setMinimumHeight(self, minh: int)#
setMinimumSize(self, minw: int, minh: int)#
setMinimumSize(self, s: QSize) None
setMinimumWidth(self, minw: int)#
setMouseTracking(self, enable: bool)#
setObjectName(self, name: str | None)#
setPalette(self, a0: QPalette)#
setPanWithArrowKeys(pan=False)#

Enable/Disable panning the graph with arrow keys.

This grabs the keyboard.

Parameters:

pan (bool) – True to enable panning, False to disable.

setParent(self, parent: QWidget | None)#
setParent(self, parent: QWidget | None, f: Qt.WindowFlags | Qt.WindowType) None
setProperty(self, name: str | None, value: Any) bool#
setSelectionMask(mask)#

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

setShortcutAutoRepeat(self, id: int, enabled: bool = True)#
setShortcutEnabled(self, id: int, enabled: bool = True)#
setSizeIncrement(self, w: int, h: int)#
setSizeIncrement(self, s: QSize) None
setSizePolicy(self, a0: QSizePolicy)#
setSizePolicy(self, hor: QSizePolicy.Policy, ver: QSizePolicy.Policy) None
setStatusBar(self, statusbar: QStatusBar | None)#
setStatusTip(self, a0: str | None)#
setStyle(self, a0: QStyle | None)#
setStyleSheet(self, styleSheet: str | None)#
setTabOrder(a0: QWidget | None, a1: QWidget | None)#
setTabPosition(self, areas: Qt.DockWidgetAreas | Qt.DockWidgetArea, tabPosition: QTabWidget.TabPosition)#
setTabShape(self, tabShape: QTabWidget.TabShape)#
setTabletTracking(self, enable: bool)#
setToolButtonStyle(self, toolButtonStyle: Qt.ToolButtonStyle)#
setToolTip(self, a0: str | None)#
setToolTipDuration(self, msec: int)#
setUnifiedTitleAndToolBarOnMac(self, set: bool)#
setUpdatesEnabled(self, enable: bool)#
setVisible(self, visible: bool)#
setWhatsThis(self, a0: str | None)#
setWindowFilePath(self, filePath: str | None)#
setWindowFlag(self, a0: Qt.WindowType, on: bool = True)#
setWindowFlags(self, type: Qt.WindowFlags | Qt.WindowType)#
setWindowIcon(self, icon: QIcon)#
setWindowIconText(self, a0: str | None)#
setWindowModality(self, windowModality: Qt.WindowModality)#
setWindowModified(self, a0: bool)#
setWindowOpacity(self, level: float)#
setWindowRole(self, a0: str | None)#
setWindowState(self, state: Qt.WindowStates | Qt.WindowState)#
setWindowTitle(self, a0: str | None)#
setXAxisAutoScale(flag=True)#

Set the X axis limits adjusting behavior of resetZoom().

Parameters:

flag (bool) – True to resize limits automatically, False to disable it.

setXAxisLogarithmic(flag)#

Set the bottom X axis scale (either linear or logarithmic).

Parameters:

flag (bool) – True to use a logarithmic scale, False for linear.

setYAxisAutoScale(flag=True)#

Set the Y axis limits adjusting behavior of resetZoom().

Parameters:

flag (bool) – True to resize limits automatically, False to disable it.

setYAxisInverted(flag=True)#

Set the Y axis orientation.

Parameters:

flag (bool) – True for Y axis going from top to bottom, False for Y axis going from bottom to top

setYAxisLogarithmic(flag)#

Set the Y axes scale (either linear or logarithmic).

Parameters:

flag (bool) – True to use a logarithmic scale, False for linear.

sharedPainter(self) QPainter | None#
show(self)#
showEvent(self, a0: QShowEvent | None)#
showFullScreen(self)#
showMaximized(self)#
showMinimized(self)#
showNormal(self)#
sigActiveCurveChanged#

Signal emitted when the active curve has changed.

It provides the following information:

  • previous: The legend of the previous active curve or None

  • legend: The legend of the new active curve or None if no curve is active

sigActiveImageChanged#

Signal emitted when the active image has changed.

It provides the following information:

  • previous: The legend of the previous active image or None

  • legend: The legend of the new active image or None if no image is active

sigActiveScatterChanged#

Signal emitted when the active Scatter has changed.

It provides the following information:

  • previous: The legend of the previous active scatter or None

  • legend: The legend of the new active image or None if no image is active

sigBackendChanged#

Signal emitted when the backend have changed.

sigContentChanged#

Signal emitted when the content of the plot is changed.

It provides the following information:

  • action: The change of the plot: ‘add’ or ‘remove’

  • kind: The kind of primitive changed: ‘curve’, ‘image’, ‘scatter’, ‘histogram’, ‘item’ or ‘marker’

  • legend: The legend of the primitive changed.

sigInteractiveModeChanged#

Signal emitted when the interactive mode has changed

It provides the source as passed to setInteractiveMode().

sigItemAboutToBeRemoved#

Signal emitted right before an item is removed from the plot.

It provides the item that will be removed.

sigItemAdded#

Signal emitted when an item was just added to the plot

It provides the added item.

sigItemRemoved#

Signal emitted right after an item was removed from the plot.

It provides the item that was removed.

sigPlotSignal#

Signal for all events of the plot.

The signal information is provided as a dict. See the plot signal documentation page for information about the content of the dict

sigSetGraphCursor#

Signal emitted when plot crosshair cursor has changed

sigSetGraphGrid#

Signal emitted when plot grid has changed

sigSetKeepDataAspectRatio#

Signal emitted when plot keep aspect ratio has changed

sigSetPanWithArrowKeys#

Signal emitted when pan with arrow keys has changed

sigVisibilityChanged#

Signal emitted when the widget becomes visible (or invisible). This happens when the widget is hidden or shown.

It provides the visible state.

signalsBlocked(self) bool#
size(self) QSize#
sizeHint(self) QSize#
sizeIncrement(self) QSize#
sizePolicy(self) QSizePolicy#
splitDockWidget(self, after: QDockWidget | None, dockwidget: QDockWidget | None, orientation: Qt.Orientation)#
stackUnder(self, a0: QWidget | None)#
startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int#
staticMetaObject = <PyQt5.QtCore.QMetaObject object>#
statusBar(self) QStatusBar | None#
statusTip(self) str#
style(self) QStyle | None#
styleSheet(self) str#
tabPosition(self, area: Qt.DockWidgetArea) QTabWidget.TabPosition#
tabShape(self) QTabWidget.TabShape#
tabifiedDockWidgetActivated#

tabifiedDockWidgetActivated(self, dockWidget: Optional[QDockWidget]) [signal]

tabifiedDockWidgets(self, dockwidget: QDockWidget | None) List[QDockWidget]#
tabifyDockWidget(self, first: QDockWidget | None, second: QDockWidget | None)#
tabletEvent(self, a0: QTabletEvent | None)#
takeCentralWidget(self) QWidget | None#
testAttribute(self, attribute: Qt.WidgetAttribute) bool#
thread(self) QThread | None#
timerEvent(self, a0: QTimerEvent | None)#
toolBar()#

Return a QToolBar from the QAction of the PlotWindow.

toolBarArea(self, toolbar: QToolBar | None) Qt.ToolBarArea#
toolBarBreak(self, toolbar: QToolBar | None) bool#
toolButtonStyle(self) Qt.ToolButtonStyle#
toolButtonStyleChanged#

toolButtonStyleChanged(self, toolButtonStyle: Qt.ToolButtonStyle) [signal]

toolTip(self) str#
toolTipDuration(self) int#
tr(self, sourceText: str | None, disambiguation: str | None = None, n: int = -1) str#
underMouse(self) bool#
ungrabGesture(self, type: Qt.GestureType)#
unifiedTitleAndToolBarOnMac(self) bool#
unsetCursor(self)#
unsetLayoutDirection(self)#
unsetLocale(self)#
update(self)#
update(self, a0: QRect) None
update(self, a0: QRegion) None
update(self, ax: int, ay: int, aw: int, ah: int) None
updateGeometry(self)#
updateMicroFocus(self)#
updatesEnabled(self) bool#
visibleRegion(self) QRegion#
whatsThis(self) str#
wheelEvent(self, a0: QWheelEvent | None)#
width(self) int#
widthMM(self) int#
winId(self) PyQt5.sip.voidptr#
window(self) QWidget | None#
windowFilePath(self) str#
windowFlags(self) Qt.WindowFlags#
windowHandle(self) QWindow | None#
windowIcon(self) QIcon#
windowIconChanged#

windowIconChanged(self, icon: QIcon) [signal]

windowIconText(self) str#
windowIconTextChanged#

windowIconTextChanged(self, iconText: Optional[str]) [signal]

windowModality(self) Qt.WindowModality#
windowOpacity(self) float#
windowRole(self) str#
windowState(self) Qt.WindowStates#
windowTitle(self) str#
windowTitleChanged#

windowTitleChanged(self, title: Optional[str]) [signal]

windowType(self) Qt.WindowType#
x(self) int#
y(self) int#