lab_driver.process_plots#

Module Contents#

Functions#

get_plot_color

Getting the color string

get_plot_marker

Getting the marker for plotting

save_figure

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

scale_auto_value

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

plot_transfer_function_norm

Function for plotting the transfer function

plot_transfer_function_metric

Function for plotting the metric, extracted from the transfer function

API#

lab_driver.process_plots.get_plot_color(idx: int) str[source]#

Getting the color string

lab_driver.process_plots.get_plot_marker(idx: int) str[source]#

Getting the marker for plotting

lab_driver.process_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.process_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.process_plots.plot_transfer_function_norm(data: dict, path2save: str = '', xlabel: str = 'Stimulus Input', ylabel: str = 'Stimulus Output', title: str = 'Transfer Function', file_name: str = '') 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

Returns:

None

lab_driver.process_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