elasticai.preprocessor._plot_helper#

Module Contents#

Functions#

get_textsize_paper

Getting the fontsize (best practice) for publishing in papers

get_plot_color_inactive

Getting the color for plotting non-spike activity in transient plots

get_plot_color

Getting the color string

get_plot_marker

Getting the marker for plotting

cm_to_inch

Translation figure size

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

extract_minmax_for_logarithmic_limits

Function for extracting the min-max value of given data for defining the logarithmic limits

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

translate_unit_to_scale_value

Translating the unit of a value from string to float

API#

elasticai.preprocessor._plot_helper.get_textsize_paper() int[source]#

Getting the fontsize (best practice) for publishing in papers

elasticai.preprocessor._plot_helper.get_plot_color_inactive() str[source]#

Getting the color for plotting non-spike activity in transient plots

elasticai.preprocessor._plot_helper.get_plot_color(idx: int) str[source]#

Getting the color string

elasticai.preprocessor._plot_helper.get_plot_marker(idx: int) str[source]#

Getting the marker for plotting

elasticai.preprocessor._plot_helper.cm_to_inch(value: float) float[source]#

Translation figure size

elasticai.preprocessor._plot_helper.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

elasticai.preprocessor._plot_helper.extract_minmax_for_logarithmic_limits(data: numpy.ndarray) tuple[float, float][source]#

Function for extracting the min-max value of given data for defining the logarithmic limits

Parameters:

data – Numpy array with data

Returns:

Tuple with limitation values for applying logarithmic y-limits

elasticai.preprocessor._plot_helper.scale_auto_value(data: float | numpy.ndarray) tuple[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

elasticai.preprocessor._plot_helper.translate_unit_to_scale_value(unit_str: str, pos: int) float[source]#

Translating the unit of a value from string to float

Parameters:
  • unit_str – String representation of the input value

  • pos – Index of scaling value in string

Returns:

Scaled value