Plotting

Classes

Containers for figures, plots, etc.

class omc3_gui.plotting.classes.DualPlotWidget(*args: Any, **kwargs: Any)[source]

A widget containing and handling two plots stacked vertically.

class omc3_gui.plotting.classes.ObservablePlotDataItem(*args: Any, **kwargs: Any)[source]

A PlotDataItem that emits a signal when visibility changes.

visibilityChanged

alias of bool

class omc3_gui.plotting.classes.PlotWidget(*args: Any, **kwargs: Any)[source]

A widget containing and handling a single plot.

Adds the look-and-feel for our omc3 guis to the default accwidgets plotwidget.

class omc3_gui.plotting.classes.ZoomingViewBox(*args: Any, **kwargs: Any)[source]

ViewBox that imitates the behavior of the Java-GUI a bit more closely than the default.

auto_zoom()[source]

Zoom to 6, 4 and 2 standard deviations and save the steps.

save_view()[source]

Save the current view to the zoom history.

set_y_range_to_n_sigma(n_sigma)[source]

Set the y-range to a number of standard deviations, assuming the data is taken from a normal distribution.

suggestPadding(axis)[source]

Suggests padding (between the data and the axis) for the autoRange function. For our purposes, we do not want any padding on the x-axis.

undo_zoom(reset: bool = False)[source]

Go back in zoom history.

Element Line Plotter

This module contains functions to plot element lines with pyqtgraph.

omc3_gui.plotting.element_lines.plot_element_lines(plot: pyqtgraph.PlotWidget, data_frame: TfsDataFrame, ranges: list[tuple[str, str]], start_zero: bool)[source]

Plot vertical lines on the plot for elements in the data_frame in the given ranges.

Parameters:
  • plot (pg.PlotWidget) -- The plot to plot the lines into.

  • data_frame (tfs.TfsDataFrame) -- The data_frame to plot the lines from.

  • ranges (list[tuple[str, str]]) -- A list of tuples of the form (start_element, end_element).

  • start_zero (bool) -- Whether to start the plot from zero or not.

Latex to HTML converter

Converts LaTeX commands for Greek letters and other symbols to HTML. Needed to be able to re-use matplotlib-labels - which understand Latex - in pyqtgraph, which does not understand Latex.

omc3_gui.plotting.latex_to_html.latex_to_html_converter(latex_str: str) str[source]

Converts LaTeX commands for Greek letters and other symbols to HTML.

Parameters:

latex_str (str) -- LaTeX string to convert.

Returns:

HTML string

Return type:

str