bec_widgets.utils.linear_region_selector#

Module for a thin wrapper (LinearRegionWrapper) around the LinearRegionItem in pyqtgraph. The class is mainly designed for usage with the BECWaveform and 1D plots.

Classes#

LinearRegionWrapper

Wrapper class for the LinearRegionItem in pyqtgraph for 1D plots (BECWaveform)

Module Contents#

class LinearRegionWrapper(plot_item: pyqtgraph.PlotItem, color: qtpy.QtGui.QColor = None, hover_color: qtpy.QtGui.QColor = None, parent=None)#

Bases: qtpy.QtCore.QObject

Wrapper class for the LinearRegionItem in pyqtgraph for 1D plots (BECWaveform)

Parameters:
  • plot_item (pg.PlotItem) – The plot item to add the region selector to.

  • parent (QObject) – The parent object.

  • color (QColor) – The color of the region selector.

  • hover_color (QColor) – The color of the region selector when the mouse is over it.

_region_change_proxy()#

Emit the region change signal. If the plot is in log mode, convert the region to log.

add_region_selector()#

Add the region selector to the plot item

change_roi_color(colors: tuple[qtpy.QtGui.QColor | str | tuple, qtpy.QtGui.QColor | str | tuple])#

Change the color and hover color of the region selector. Hover color means the color when the mouse is over the region.

Parameters:

colors (tuple) – Tuple with the color and hover color

check_log()#

Check if the plot is in log mode.

cleanup()#

Cleanup the widget.

remove_region_selector()#

Remove the region selector from the plot item

is_log_x = None#
linear_region_selector#
plot_item#
proxy = None#
region_changed#