lab_driver.plots
#
Module Contents#
Functions#
Getting the color string |
|
Getting the font size for paper work |
|
Getting the marker for plotting |
|
Saving figure in given format Args: fig: Matplot which will be saved path: Path for saving the figure name: Name of the plot formats: List with data formats for saving the figures Returns: None |
|
Getting the scaling value and corresponding string notation for unit scaling in plots Args: data: Array or value for calculating the SI scaling value Returns: Tuple with [0] = scaling value and [1] = SI pre-unit |
|
Function for plotting the transfer function |
|
Function for plotting the metric, extracted from the transfer function |
|
Plotting the spectral data, measured with R&S MXO44 |
|
Plotting the data from Frequency Response Analysis (FRA) using R&S MXO44 |
|
API#
- lab_driver.plots.save_figure(fig, path: str, name: str, formats: list = ('pdf', 'svg')) None [source]#
Saving figure in given format Args: fig: Matplot which will be saved path: Path for saving the figure name: Name of the plot formats: List with data formats for saving the figures Returns: None
- lab_driver.plots.scale_auto_value(data: numpy.ndarray | float) [float, str] [source]#
Getting the scaling value and corresponding string notation for unit scaling in plots Args: data: Array or value for calculating the SI scaling value Returns: Tuple with [0] = scaling value and [1] = SI pre-unit
- lab_driver.plots.plot_transfer_function_norm(data: dict, path2save: str = '', xlabel: str = 'Stimulus Input', ylabel: str = 'Stimulus Output', title: str = 'Transfer Function', file_name: str = '', show_plot: bool = True) None [source]#
Function for plotting the transfer function
- Parameters:
data – Dictionary with extracted values from measurement data
path2save – Path for saving the figure
xlabel – Text Label for x-axis
ylabel – Text Label for y-axis
title – Text Label for title
file_name – File name of the saved figure
show_plot – Boolean for showing the plot
- Returns:
None
- lab_driver.plots.plot_transfer_function_metric(data: dict, func: object, path2save: str = '', xlabel: str = 'Stimulus Input', ylabel: str = 'Stimulus Output', title: str = 'Transfer Function', file_name: str = '') None [source]#
Function for plotting the metric, extracted from the transfer function
- Parameters:
data – Dictionary with pre-processed data from measurement with keys: [‘stim’, ‘ch
’: {‘mean’, ‘std’}} func – Function for calculating the metric
path2save – Path for saving the figure
xlabel – Text Label for x-axis
ylabel – Text Label for y-axis
title – Text Label for title
file_name – File name of the saved figure
- Returns:
None
- lab_driver.plots.plot_spectral_data(data: dict, N_harmonics: int = 6, file_name: str = '', path2save: str = '', delta_peaks: int = 20, show_peaks: bool = True, show_plot: bool = True, is_input_db: bool = True) None [source]#
Plotting the spectral data, measured with R&S MXO44
- Parameters:
data – Dictionary with spectral data from measurement
N_harmonics – Number of harmonics for calculation and plot
file_name – File name of the saved figure
path2save – Path for saving the figure
delta_peaks – Number of positions around the peaks
show_peaks – Boolean for highlighting the harmonics
show_plot – Boolean for showing the plot
is_input_db – Boolean for whether the data is logarithmic [dB]
- Returns:
None
- lab_driver.plots.plot_fra_data(data: dict, file_name: str = '', path2save: str = '', show_plot: bool = True) None [source]#
Plotting the data from Frequency Response Analysis (FRA) using R&S MXO44
- Parameters:
data – Dictionary with measured data from device
file_name – File name of the saved figure
path2save – Path for saving the figure
show_plot – Boolean for showing the plot