plot_detections#

plot_detections(df: DataFrame, detections: DataFrame, data_repr: str | None = None, **kwargs) Figure[source][source]#

Plot detected change points or segment anomalies on a time series.

Parameters:
dfpd.DataFrame

The time series data to plot. The index should represent the time points, while the columns represent the values of the time series.

detectionspd.DataFrame

The detections to plot, on the format returned by detectors’ predict method.

data_reprstr

The representation of the data to plot. Can be one of the following:

  • “line”: Line plot with different colors for each variable.

  • “subplot-line”: Line plot with subplots for each variable.

  • “point”: Scatter plot with different colors for each variable.

  • “subplot-point”: Scatter plot with subplots for each variable.

  • “heatmap”: Heatmap representation of the time series.

Returns:
plotly.graph_objects.Figure

A Plotly figure with the time series and highlighed detected events in red.