Plot handler#
The cdl.core.gui.plothandler
module provides plot handlers for signal
and image panels, that is, classes handling PlotPy plot items for representing
signals and images.
Signal plot handler#
- class cdl.core.gui.plothandler.SignalPlotHandler(panel: BaseDataPanel, plotwidget: PlotWidget)[source]#
Object handling signal plot items, plot dialogs, plot options
- toggle_anti_aliasing(state: bool) None [source]#
Toggle anti-aliasing
- Parameters:
state – if True, enable anti-aliasing
- get_current_plot_options() PlotOptions [source]#
Return standard signal/image plot options
- add_shapes(oid: str, do_autoscale: bool = False) None #
Add geometric shape items associated to computed results and annotations, for the object with the given uuid
- get(key: str, default: CurveItem | MaskedImageItem | None = None) CurveItem | MaskedImageItem | None #
Return item associated to object uuid. If the key is not found, default is returned if given, otherwise None is returned.
- get_obj_from_item(item: CurveItem | MaskedImageItem) SignalObj | ImageObj | None #
Return object associated to plot item
- Parameters:
item – plot item
- Returns:
Object associated to plot item
- refresh_plot(what: str, update_items: bool = True, force: bool = False) None #
Refresh plot.
- Parameters:
what – string describing the objects to refresh. Valid values are “selected” (refresh the selected objects), “all” (refresh all objects), “existing” (refresh existing plot items), or an object uuid.
update_items – if True, update the items. If False, only show the items (do not update them, except if the option “Use reference item LUT range” is enabled and more than one item is selected). Defaults to True.
force – if True, force refresh even if auto refresh is disabled.
- Raises:
ValueError – if what is not a valid value
- set_auto_refresh(auto_refresh: bool) None #
Set auto refresh mode.
- Parameters:
auto_refresh – if True, refresh plot items automatically
- set_show_first_only(show_first_only: bool) None #
Set show first only mode.
- Parameters:
show_first_only – if True, show only the first selected item
Image plot handler#
- class cdl.core.gui.plothandler.ImagePlotHandler(panel: BaseDataPanel, plotwidget: PlotWidget)[source]#
Object handling image plot items, plot dialogs, plot options
- static update_item_according_to_ref_item(item: MaskedImageItem, ref_item: MaskedImageItem) None [source]#
Update plot item according to reference item
- refresh_plot(what: str, update_items: bool = True, force: bool = False) None [source]#
Refresh plot.
- Parameters:
what – string describing the objects to refresh. Valid values are “selected” (refresh the selected objects), “all” (refresh all objects), “existing” (refresh existing plot items), or an object uuid.
update_items – if True, update the items. If False, only show the items (do not update them, except if the option “Use reference item LUT range” is enabled and more than one item is selected). Defaults to True.
force – if True, force refresh even if auto refresh is disabled.
- Raises:
ValueError – if what is not a valid value
- get_current_plot_options() PlotOptions [source]#
Return standard signal/image plot options
- add_shapes(oid: str, do_autoscale: bool = False) None #
Add geometric shape items associated to computed results and annotations, for the object with the given uuid
- get(key: str, default: CurveItem | MaskedImageItem | None = None) CurveItem | MaskedImageItem | None #
Return item associated to object uuid. If the key is not found, default is returned if given, otherwise None is returned.
- get_obj_from_item(item: CurveItem | MaskedImageItem) SignalObj | ImageObj | None #
Return object associated to plot item
- Parameters:
item – plot item
- Returns:
Object associated to plot item
- set_auto_refresh(auto_refresh: bool) None #
Set auto refresh mode.
- Parameters:
auto_refresh – if True, refresh plot items automatically