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.
Connects the callback functions to events
deselect_all_complex_types_except
(complex_type)Deselects all complex types except the specified type.
Called when the selected functions is changed
Sets the complex type to imaginary
Sets the complex type to magnitude
Sets the complex type to magnitude and phase
Sets the complex type to phase
set_real
()Sets the complex type to real
Sets the complex type to real and imaginary
update
()Updates the figure in the GUIPlot
Updates whether the abscissa should be plotted as log scale
Disables the update button if set to auto-update
update_data
(*data_to_plot, ...)Updates whether the ordinate should be plotted as log scale
Attributes
- 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.