timesead.utils.plot_utils

Functions

plot_error_bars(means, deviations[, ax, offset])

plot_histogram([data, resolution, yticks, ax, ...])

plot_sequence_against_anomaly(values, targets[, ax, ...])

Plot 1D sequence against anomaly windows.

save_plot(path)

Save the current figure and close it.

set_style([stylefile])

Sets the rcParmaters of matplotlib from a style file.

Module Contents

timesead.utils.plot_utils.plot_error_bars(means: list, deviations: list, ax: matplotlib.pyplot.Axes | None = None, offset: int = 0, **kwargs)
Parameters:
  • means (list)

  • deviations (list)

  • ax (Optional[matplotlib.pyplot.Axes])

  • offset (int)

timesead.utils.plot_utils.plot_histogram(data: List[int] | None = None, resolution: int = 100, yticks: int | List | None = None, ax: matplotlib.axes.Axes | None = None, hist_range: Tuple[int, int] = (0, 1), xticks: List[int] | None = None, **kwargs)
Parameters:
  • data (Optional[List[int]])

  • resolution (int)

  • yticks (Optional[Union[int, List]])

  • ax (Optional[matplotlib.axes.Axes])

  • hist_range (Tuple[int, int])

  • xticks (Optional[List[int]])

timesead.utils.plot_utils.plot_sequence_against_anomaly(values: List[float], targets: List[float], ax: matplotlib.axes.Axes | None = None, xticks: int | List | None = None, scatter: bool = True, yticks: bool = True)

Plot 1D sequence against anomaly windows.

Parameters:
  • values (List[float]) – Sequence of values to plot against anomalies.

  • targets (List[float]) – List of labels taking values in {0,1} of the same length as values.

  • ax (Optional[mplt.axes.Axes]) – Axes object to use for plotting. Uses current Axes if None.

  • xticks (Optional[Union[int, List]]) – Generates <xticks> xticks if int. Uses xticks directly if List. No xticks if None.

  • scatter (bool) – Draw values as line plot or scatter plot.

  • yticks (bool) – Set yticks.

timesead.utils.plot_utils.save_plot(path: str)

Save the current figure and close it.

Parameters:

path (str) – Path to save the figure to.

timesead.utils.plot_utils.set_style(stylefile: str = os.path.join(RESOURCE_DIRECTORY, 'style', 'timesead.mplstyle'))

Sets the rcParmaters of matplotlib from a style file.

Parameters:

stylefile (str) – Style file in mplstyle format.