sdynpy.core.sdynpy_data.GUIPlot

class GUIPlot(*data_to_plot, **labeled_data_to_plot)[source]

Bases: QMainWindow

An iteractive plot window allowing users to visualize data

__init__(*data_to_plot, **labeled_data_to_plot)[source]

Create a GUIPlot window to visualize data.

Multiple datasets can be overlaid by providing additional datasets as arguments. Position arguments will be labelled generically in the legend. Keyword arguments will be labelled with their keywords with _ replaced by ` `.

Parameters
  • *data_to_plot (NDDataArray) – Data to visualize. Data passed by positional argument will be labeled generically in the legend

  • **labeled_data_to_plot (NDDataArray) – Data to visualize. Data passed by keyword argument will be labeled with its keyword

  • abscissa_markers (np.ndarray) – Abscissa values at which markers will be placed. If not specified, no markers will be added. Markers will be added to all plotted curves if this argument is passed. To add markers to just a specific plotted data, pass the argument abscissa_markers_* where * is replaced with either the index of the data that was passed via a positional argument, or the keyword of the data that was passed via a keyword argument. Must be passed as a keyword argument.

  • abscissa_marker_labels (iterable) – Labels that will be applied to the markers. If not specified, no label will be applied. If a single string is passed, it will be passed to the .format method with keyword arguments index and abscissa. This marker label will be used for all plotted curves if this argument is passed. To add markers to just a specific plotted data, pass the argument abscissa_marker_labels_* where * is replaced with either the index of the data that was passed via a positional argument, or the keyword of the data that was passed via a keyword argument. Must be passed as a keyword argument.

  • abscissa_marker_type (str:) – The type of marker that will be applied. Can be ‘vline’ for a vertical line across the axis, or it can be a pyqtgraph symbol specifier (e.g. ‘x’, ‘o’, ‘star’, etc.) which will be placed on the plotted curves. If not specified, a vertical line will be used. This marker type will be used for all plotted curves if this argument is passed. To add markers to just a specific plotted data, pass the argument abscissa_marker_type_* where * is replaced with either the index of the data that was passed via a positional argument, or the keyword of the data that was passed via a keyword argument. Must be passed as a keyword argument.

Return type

None.

Methods

__init__(*data_to_plot, **labeled_data_to_plot)

Create a GUIPlot window to visualize data.

connect_callbacks()

Connects the callback functions to events

deselect_all_complex_types_except(complex_type)

Deselects all complex types except the specified type.

selection_changed()

Called when the selected functions is changed

set_imaginary()

Sets the complex type to imaginary

set_magnitude()

Sets the complex type to magnitude

set_magnitude_phase()

Sets the complex type to magnitude and phase

set_phase()

Sets the complex type to phase

set_real()

Sets the complex type to real

set_real_imag()

Sets the complex type to real and imaginary

update()

Updates the figure in the GUIPlot

update_abscissa_log()

Updates whether the abscissa should be plotted as log scale

update_checkbox()

Disables the update button if set to auto-update

update_data(*data_to_plot, ...)

update_ordinate_log()

Updates whether the ordinate should be plotted as log scale

Attributes

connect_callbacks()[source]

Connects the callback functions to events

Return type

None.

deselect_all_complex_types_except(complex_type)[source]

Deselects all complex types except the specified type.

Makes the checkboxes in the menu act like radiobuttons

Parameters

complex_type (ComplexType) – Enumeration specifying which complex plot type is selected

Return type

None.

selection_changed()[source]

Called when the selected functions is changed

set_imaginary()[source]

Sets the complex type to imaginary

set_magnitude()[source]

Sets the complex type to magnitude

set_magnitude_phase()[source]

Sets the complex type to magnitude and phase

set_phase()[source]

Sets the complex type to phase

set_real()[source]

Sets the complex type to real

set_real_imag()[source]

Sets the complex type to real and imaginary

update()[source]

Updates the figure in the GUIPlot

Return type

None.

update_abscissa_log()[source]

Updates whether the abscissa should be plotted as log scale

update_checkbox()[source]

Disables the update button if set to auto-update

update_data(*data_to_plot, **labeled_data_to_plot)[source]
update_ordinate_log()[source]

Updates whether the ordinate should be plotted as log scale