tseda.visualization

tseda.visualization — matplotlib plot suite for time series EDA.

All functions return a matplotlib.figure.Figure. Call set_style() once at the start of a session to apply the tseda theme.

Style

tseda.visualization.base.set_style()[source]

Apply the tseda matplotlib style globally.

Sets font size, grid style, and removes top/right spines. Safe to call multiple times.

Return type:

None

Time plots

tseda.visualization.time_plots.plot_series(ts, *, rolling_window=None, ax=None, title=None, figsize=None)[source]

Line plot of ts with an optional rolling-mean overlay.

Parameters:
  • ts (TimeSeries)

  • rolling_window (int, optional) – If given, overlay a rolling mean of this width.

  • ax (optional) – Standard plot arguments.

  • title (optional) – Standard plot arguments.

  • figsize (optional) – Standard plot arguments.

Return type:

matplotlib.figure.Figure

tseda.visualization.time_plots.plot_seasonal_subseries(ts, period, *, ax=None, title=None, figsize=None)[source]

One sub-panel per season position, each showing all cycles.

Parameters:
  • ts (TimeSeries)

  • period (int) – Seasonal period (number of sub-panels).

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.time_plots.plot_lag(ts, lags=(1, 2, 7), *, figsize=None, title=None)[source]

Scatter-plot matrix of ts versus lagged copies.

Parameters:
  • ts (TimeSeries)

  • lags (sequence of int) – Lag values to plot.

  • figsize (optional)

  • title (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.time_plots.plot_calendar_heatmap(ts, *, ax=None, title=None, figsize=None)[source]

Heatmap of values by day-of-week (columns) × calendar week (rows).

Works best with daily or sub-daily data. For non-daily series a weekly-aggregated heatmap (ISO week × year) is produced instead.

Parameters:
  • ts (TimeSeries)

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.time_plots.plot_annual_boxplots(ts, *, ax=None, title=None, figsize=None)[source]

Box-and-whisker plot of values grouped by calendar month.

Parameters:
  • ts (TimeSeries)

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.time_plots.plot_density_ridge(ts, *, ax=None, title=None, figsize=None)[source]

Year-over-year density ridgeline (KDE per year).

Each year is a separate KDE curve, offset vertically.

Parameters:
  • ts (TimeSeries)

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

Distribution plots

tseda.visualization.distribution_plots.plot_distribution(ts, *, bins=30, ax=None, title=None, figsize=None)[source]

Histogram + KDE + fitted-normal overlay.

Parameters:
  • ts (TimeSeries)

  • bins (int) – Number of histogram bins.

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.distribution_plots.plot_qq(ts, *, ax=None, title=None, figsize=None)[source]

Quantile-quantile plot of ts values against a standard normal.

Parameters:
  • ts (TimeSeries)

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.distribution_plots.plot_rolling_stats(ts, window, *, ax=None, title=None, figsize=None)[source]

Two-panel plot: rolling mean (top) and rolling std (bottom).

Parameters:
  • ts (TimeSeries)

  • window (int) – Rolling window width in observations.

  • ax (optional) – ax is ignored for this multi-panel plot; a new figure is always created unless passed explicitly.

  • title (optional) – ax is ignored for this multi-panel plot; a new figure is always created unless passed explicitly.

  • figsize (optional) – ax is ignored for this multi-panel plot; a new figure is always created unless passed explicitly.

Return type:

matplotlib.figure.Figure

Correlation plots

tseda.visualization.correlation_plots.plot_acf_pacf(result, *, figsize=None, title=None)[source]

Side-by-side ACF and PACF stem plots with ±95 % confidence bands.

Parameters:
Return type:

matplotlib.figure.Figure

tseda.visualization.correlation_plots.plot_acf_heatmap(ts, max_lag=40, *, ax=None, title=None, figsize=None)[source]

Rolling-window ACF heatmap — lag on y-axis, time window on x-axis.

For each overlapping window the ACF is computed and displayed as a colour column. High ACF magnitude at a particular lag is visible as a persistent horizontal band.

Parameters:
  • ts (TimeSeries)

  • max_lag (int) – Maximum lag to show.

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

Decomposition plots

tseda.visualization.decomposition_plots.plot_decomposition(result, *, figsize=None, title=None)[source]

Four-panel decomposition plot (observed / trend / seasonal / residual).

Parameters:
Return type:

matplotlib.figure.Figure

tseda.visualization.decomposition_plots.plot_strength_radar(result, *, ax=None, title=None, figsize=None)[source]

Radar chart of four decomposition strength metrics.

Metrics (all in [0, 1]):

  • Trend strength

  • Seasonal strength

  • Signal (1 − residual variance / total variance)

  • Smoothness (trend variance / original variance)

Parameters:
Return type:

matplotlib.figure.Figure

tseda.visualization.decomposition_plots.plot_residual_diagnostics(result, *, figsize=None, title=None)[source]

Two-panel residual diagnostics: histogram+KDE (left) and ACF (right).

Parameters:
Return type:

matplotlib.figure.Figure

Seasonality plots

tseda.visualization.seasonality_plots.plot_periodogram(report, *, ax=None, title=None, figsize=None)[source]

FFT power spectrum with dominant periods marked.

Parameters:
Return type:

matplotlib.figure.Figure

tseda.visualization.seasonality_plots.plot_polar_seasonal(ts, period, *, ax=None, title=None, figsize=None)[source]

Values projected onto a clock-face polar chart.

Each observation is plotted at angle = (position mod period) / period × 2π and radius proportional to the normalised value.

Parameters:
  • ts (TimeSeries)

  • period (int)

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.seasonality_plots.plot_season_heatmap(ts, period, *, ax=None, title=None, figsize=None)[source]

Period-phase × cycle heatmap.

Rows = phase within period (0 … period−1). Columns = cycle index. Cell colour = observed value.

Parameters:
  • ts (TimeSeries)

  • period (int)

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.seasonality_plots.plot_monthly_boxplots(ts, *, ax=None, title=None, figsize=None)[source]

Box-and-whisker plot per calendar month position.

Parameters:
  • ts (TimeSeries)

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

Anomaly plots

tseda.visualization.anomaly_plots.plot_anomalies(ts, report, *, ax=None, title=None, figsize=None)[source]

Line plot of ts with anomaly positions highlighted as red markers.

Parameters:
Return type:

matplotlib.figure.Figure

tseda.visualization.anomaly_plots.plot_anomaly_scores(report, *, ax=None, title=None, figsize=None)[source]

Anomaly score timeline with a reference threshold line at 1.0.

The scores field of AnomalyReport is normalised so that scores ≥ 1.0 correspond to detected anomalies.

Parameters:
  • report (AnomalyReport)

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.anomaly_plots.plot_anomaly_heatmap(ts, reports, *, ax=None, title=None, figsize=None)[source]

Multi-method anomaly agreement heatmap.

Rows = detection methods; columns = time positions. Cells are 1 (anomaly detected) or 0 (normal). Persistent vertical columns indicate high-agreement anomalies.

Parameters:
Return type:

matplotlib.figure.Figure

Changepoint plots

tseda.visualization.changepoint_plots.plot_changepoints(ts, report, *, ax=None, title=None, figsize=None)[source]

Line plot of ts with vertical dashed lines at each changepoint.

Parameters:
Return type:

matplotlib.figure.Figure

tseda.visualization.changepoint_plots.plot_cusum(ts, report, *, ax=None, title=None, figsize=None)[source]

CUSUM score chart from a ChangepointReport.

Plots the normalised CUSUM scores stored in report.scores and marks changepoint positions with vertical lines.

Parameters:
Return type:

matplotlib.figure.Figure

tseda.visualization.changepoint_plots.plot_segment_means(ts, report, *, ax=None, title=None, figsize=None)[source]

Series with a step-function overlay of per-segment means.

Each segment (between consecutive changepoints) is annotated with its sample mean drawn as a horizontal line.

Parameters:
Return type:

matplotlib.figure.Figure

Quality plots

tseda.visualization.quality_plots.plot_missing_heatmap(ts, *, ax=None, title=None, figsize=None)[source]

NaN positions displayed as a binary heatmap.

For long series the observations are binned into columns to keep the plot readable. Rows represent equal-sized chunks of the series; each cell is red if any NaN is present in that chunk, white otherwise.

Parameters:
  • ts (TimeSeries)

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.quality_plots.plot_outliers(ts, report, *, ax=None, title=None, figsize=None)[source]

Series line plot with IQR fence lines and outlier markers.

Parameters:
Return type:

matplotlib.figure.Figure

tseda.visualization.quality_plots.plot_outlier_score(ts, report, *, ax=None, title=None, figsize=None)[source]

Outlier score timeline with a threshold reference line at 1.0.

Parameters:
Return type:

matplotlib.figure.Figure

tseda.visualization.set_style()[source]

Apply the tseda matplotlib style globally.

Sets font size, grid style, and removes top/right spines. Safe to call multiple times.

Return type:

None

tseda.visualization.plot_series(ts, *, rolling_window=None, ax=None, title=None, figsize=None)[source]

Line plot of ts with an optional rolling-mean overlay.

Parameters:
  • ts (TimeSeries)

  • rolling_window (int, optional) – If given, overlay a rolling mean of this width.

  • ax (optional) – Standard plot arguments.

  • title (optional) – Standard plot arguments.

  • figsize (optional) – Standard plot arguments.

Return type:

matplotlib.figure.Figure

tseda.visualization.plot_seasonal_subseries(ts, period, *, ax=None, title=None, figsize=None)[source]

One sub-panel per season position, each showing all cycles.

Parameters:
  • ts (TimeSeries)

  • period (int) – Seasonal period (number of sub-panels).

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.plot_lag(ts, lags=(1, 2, 7), *, figsize=None, title=None)[source]

Scatter-plot matrix of ts versus lagged copies.

Parameters:
  • ts (TimeSeries)

  • lags (sequence of int) – Lag values to plot.

  • figsize (optional)

  • title (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.plot_calendar_heatmap(ts, *, ax=None, title=None, figsize=None)[source]

Heatmap of values by day-of-week (columns) × calendar week (rows).

Works best with daily or sub-daily data. For non-daily series a weekly-aggregated heatmap (ISO week × year) is produced instead.

Parameters:
  • ts (TimeSeries)

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.plot_annual_boxplots(ts, *, ax=None, title=None, figsize=None)[source]

Box-and-whisker plot of values grouped by calendar month.

Parameters:
  • ts (TimeSeries)

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.plot_density_ridge(ts, *, ax=None, title=None, figsize=None)[source]

Year-over-year density ridgeline (KDE per year).

Each year is a separate KDE curve, offset vertically.

Parameters:
  • ts (TimeSeries)

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.plot_distribution(ts, *, bins=30, ax=None, title=None, figsize=None)[source]

Histogram + KDE + fitted-normal overlay.

Parameters:
  • ts (TimeSeries)

  • bins (int) – Number of histogram bins.

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.plot_qq(ts, *, ax=None, title=None, figsize=None)[source]

Quantile-quantile plot of ts values against a standard normal.

Parameters:
  • ts (TimeSeries)

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.plot_rolling_stats(ts, window, *, ax=None, title=None, figsize=None)[source]

Two-panel plot: rolling mean (top) and rolling std (bottom).

Parameters:
  • ts (TimeSeries)

  • window (int) – Rolling window width in observations.

  • ax (optional) – ax is ignored for this multi-panel plot; a new figure is always created unless passed explicitly.

  • title (optional) – ax is ignored for this multi-panel plot; a new figure is always created unless passed explicitly.

  • figsize (optional) – ax is ignored for this multi-panel plot; a new figure is always created unless passed explicitly.

Return type:

matplotlib.figure.Figure

tseda.visualization.plot_acf_pacf(result, *, figsize=None, title=None)[source]

Side-by-side ACF and PACF stem plots with ±95 % confidence bands.

Parameters:
Return type:

matplotlib.figure.Figure

tseda.visualization.plot_acf_heatmap(ts, max_lag=40, *, ax=None, title=None, figsize=None)[source]

Rolling-window ACF heatmap — lag on y-axis, time window on x-axis.

For each overlapping window the ACF is computed and displayed as a colour column. High ACF magnitude at a particular lag is visible as a persistent horizontal band.

Parameters:
  • ts (TimeSeries)

  • max_lag (int) – Maximum lag to show.

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.plot_decomposition(result, *, figsize=None, title=None)[source]

Four-panel decomposition plot (observed / trend / seasonal / residual).

Parameters:
Return type:

matplotlib.figure.Figure

tseda.visualization.plot_strength_radar(result, *, ax=None, title=None, figsize=None)[source]

Radar chart of four decomposition strength metrics.

Metrics (all in [0, 1]):

  • Trend strength

  • Seasonal strength

  • Signal (1 − residual variance / total variance)

  • Smoothness (trend variance / original variance)

Parameters:
Return type:

matplotlib.figure.Figure

tseda.visualization.plot_residual_diagnostics(result, *, figsize=None, title=None)[source]

Two-panel residual diagnostics: histogram+KDE (left) and ACF (right).

Parameters:
Return type:

matplotlib.figure.Figure

tseda.visualization.plot_periodogram(report, *, ax=None, title=None, figsize=None)[source]

FFT power spectrum with dominant periods marked.

Parameters:
Return type:

matplotlib.figure.Figure

tseda.visualization.plot_polar_seasonal(ts, period, *, ax=None, title=None, figsize=None)[source]

Values projected onto a clock-face polar chart.

Each observation is plotted at angle = (position mod period) / period × 2π and radius proportional to the normalised value.

Parameters:
  • ts (TimeSeries)

  • period (int)

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.plot_season_heatmap(ts, period, *, ax=None, title=None, figsize=None)[source]

Period-phase × cycle heatmap.

Rows = phase within period (0 … period−1). Columns = cycle index. Cell colour = observed value.

Parameters:
  • ts (TimeSeries)

  • period (int)

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.plot_monthly_boxplots(ts, *, ax=None, title=None, figsize=None)[source]

Box-and-whisker plot per calendar month position.

Parameters:
  • ts (TimeSeries)

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.plot_anomalies(ts, report, *, ax=None, title=None, figsize=None)[source]

Line plot of ts with anomaly positions highlighted as red markers.

Parameters:
Return type:

matplotlib.figure.Figure

tseda.visualization.plot_anomaly_scores(report, *, ax=None, title=None, figsize=None)[source]

Anomaly score timeline with a reference threshold line at 1.0.

The scores field of AnomalyReport is normalised so that scores ≥ 1.0 correspond to detected anomalies.

Parameters:
  • report (AnomalyReport)

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.plot_anomaly_heatmap(ts, reports, *, ax=None, title=None, figsize=None)[source]

Multi-method anomaly agreement heatmap.

Rows = detection methods; columns = time positions. Cells are 1 (anomaly detected) or 0 (normal). Persistent vertical columns indicate high-agreement anomalies.

Parameters:
Return type:

matplotlib.figure.Figure

tseda.visualization.plot_changepoints(ts, report, *, ax=None, title=None, figsize=None)[source]

Line plot of ts with vertical dashed lines at each changepoint.

Parameters:
Return type:

matplotlib.figure.Figure

tseda.visualization.plot_cusum(ts, report, *, ax=None, title=None, figsize=None)[source]

CUSUM score chart from a ChangepointReport.

Plots the normalised CUSUM scores stored in report.scores and marks changepoint positions with vertical lines.

Parameters:
Return type:

matplotlib.figure.Figure

tseda.visualization.plot_segment_means(ts, report, *, ax=None, title=None, figsize=None)[source]

Series with a step-function overlay of per-segment means.

Each segment (between consecutive changepoints) is annotated with its sample mean drawn as a horizontal line.

Parameters:
Return type:

matplotlib.figure.Figure

tseda.visualization.plot_missing_heatmap(ts, *, ax=None, title=None, figsize=None)[source]

NaN positions displayed as a binary heatmap.

For long series the observations are binned into columns to keep the plot readable. Rows represent equal-sized chunks of the series; each cell is red if any NaN is present in that chunk, white otherwise.

Parameters:
  • ts (TimeSeries)

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.plot_outliers(ts, report, *, ax=None, title=None, figsize=None)[source]

Series line plot with IQR fence lines and outlier markers.

Parameters:
Return type:

matplotlib.figure.Figure

tseda.visualization.plot_outlier_score(ts, report, *, ax=None, title=None, figsize=None)[source]

Outlier score timeline with a threshold reference line at 1.0.

Parameters:
Return type:

matplotlib.figure.Figure

Style

tseda.visualization.base.set_style()[source]

Apply the tseda matplotlib style globally.

Sets font size, grid style, and removes top/right spines. Safe to call multiple times.

Return type:

None

Time Plots

tseda.visualization.time_plots.plot_series(ts, *, rolling_window=None, ax=None, title=None, figsize=None)[source]

Line plot of ts with an optional rolling-mean overlay.

Parameters:
  • ts (TimeSeries)

  • rolling_window (int, optional) – If given, overlay a rolling mean of this width.

  • ax (optional) – Standard plot arguments.

  • title (optional) – Standard plot arguments.

  • figsize (optional) – Standard plot arguments.

Return type:

matplotlib.figure.Figure

tseda.visualization.time_plots.plot_seasonal_subseries(ts, period, *, ax=None, title=None, figsize=None)[source]

One sub-panel per season position, each showing all cycles.

Parameters:
  • ts (TimeSeries)

  • period (int) – Seasonal period (number of sub-panels).

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.time_plots.plot_lag(ts, lags=(1, 2, 7), *, figsize=None, title=None)[source]

Scatter-plot matrix of ts versus lagged copies.

Parameters:
  • ts (TimeSeries)

  • lags (sequence of int) – Lag values to plot.

  • figsize (optional)

  • title (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.time_plots.plot_calendar_heatmap(ts, *, ax=None, title=None, figsize=None)[source]

Heatmap of values by day-of-week (columns) × calendar week (rows).

Works best with daily or sub-daily data. For non-daily series a weekly-aggregated heatmap (ISO week × year) is produced instead.

Parameters:
  • ts (TimeSeries)

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.time_plots.plot_annual_boxplots(ts, *, ax=None, title=None, figsize=None)[source]

Box-and-whisker plot of values grouped by calendar month.

Parameters:
  • ts (TimeSeries)

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.time_plots.plot_density_ridge(ts, *, ax=None, title=None, figsize=None)[source]

Year-over-year density ridgeline (KDE per year).

Each year is a separate KDE curve, offset vertically.

Parameters:
  • ts (TimeSeries)

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

Distribution Plots

tseda.visualization.distribution_plots.plot_distribution(ts, *, bins=30, ax=None, title=None, figsize=None)[source]

Histogram + KDE + fitted-normal overlay.

Parameters:
  • ts (TimeSeries)

  • bins (int) – Number of histogram bins.

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.distribution_plots.plot_qq(ts, *, ax=None, title=None, figsize=None)[source]

Quantile-quantile plot of ts values against a standard normal.

Parameters:
  • ts (TimeSeries)

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.distribution_plots.plot_rolling_stats(ts, window, *, ax=None, title=None, figsize=None)[source]

Two-panel plot: rolling mean (top) and rolling std (bottom).

Parameters:
  • ts (TimeSeries)

  • window (int) – Rolling window width in observations.

  • ax (optional) – ax is ignored for this multi-panel plot; a new figure is always created unless passed explicitly.

  • title (optional) – ax is ignored for this multi-panel plot; a new figure is always created unless passed explicitly.

  • figsize (optional) – ax is ignored for this multi-panel plot; a new figure is always created unless passed explicitly.

Return type:

matplotlib.figure.Figure

Correlation Plots

tseda.visualization.correlation_plots.plot_acf_pacf(result, *, figsize=None, title=None)[source]

Side-by-side ACF and PACF stem plots with ±95 % confidence bands.

Parameters:
Return type:

matplotlib.figure.Figure

tseda.visualization.correlation_plots.plot_acf_heatmap(ts, max_lag=40, *, ax=None, title=None, figsize=None)[source]

Rolling-window ACF heatmap — lag on y-axis, time window on x-axis.

For each overlapping window the ACF is computed and displayed as a colour column. High ACF magnitude at a particular lag is visible as a persistent horizontal band.

Parameters:
  • ts (TimeSeries)

  • max_lag (int) – Maximum lag to show.

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

Decomposition Plots

tseda.visualization.decomposition_plots.plot_decomposition(result, *, figsize=None, title=None)[source]

Four-panel decomposition plot (observed / trend / seasonal / residual).

Parameters:
Return type:

matplotlib.figure.Figure

tseda.visualization.decomposition_plots.plot_strength_radar(result, *, ax=None, title=None, figsize=None)[source]

Radar chart of four decomposition strength metrics.

Metrics (all in [0, 1]):

  • Trend strength

  • Seasonal strength

  • Signal (1 − residual variance / total variance)

  • Smoothness (trend variance / original variance)

Parameters:
Return type:

matplotlib.figure.Figure

tseda.visualization.decomposition_plots.plot_residual_diagnostics(result, *, figsize=None, title=None)[source]

Two-panel residual diagnostics: histogram+KDE (left) and ACF (right).

Parameters:
Return type:

matplotlib.figure.Figure

Seasonality Plots

tseda.visualization.seasonality_plots.plot_periodogram(report, *, ax=None, title=None, figsize=None)[source]

FFT power spectrum with dominant periods marked.

Parameters:
Return type:

matplotlib.figure.Figure

tseda.visualization.seasonality_plots.plot_polar_seasonal(ts, period, *, ax=None, title=None, figsize=None)[source]

Values projected onto a clock-face polar chart.

Each observation is plotted at angle = (position mod period) / period × 2π and radius proportional to the normalised value.

Parameters:
  • ts (TimeSeries)

  • period (int)

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.seasonality_plots.plot_season_heatmap(ts, period, *, ax=None, title=None, figsize=None)[source]

Period-phase × cycle heatmap.

Rows = phase within period (0 … period−1). Columns = cycle index. Cell colour = observed value.

Parameters:
  • ts (TimeSeries)

  • period (int)

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.seasonality_plots.plot_monthly_boxplots(ts, *, ax=None, title=None, figsize=None)[source]

Box-and-whisker plot per calendar month position.

Parameters:
  • ts (TimeSeries)

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

Anomaly Plots

tseda.visualization.anomaly_plots.plot_anomalies(ts, report, *, ax=None, title=None, figsize=None)[source]

Line plot of ts with anomaly positions highlighted as red markers.

Parameters:
Return type:

matplotlib.figure.Figure

tseda.visualization.anomaly_plots.plot_anomaly_scores(report, *, ax=None, title=None, figsize=None)[source]

Anomaly score timeline with a reference threshold line at 1.0.

The scores field of AnomalyReport is normalised so that scores ≥ 1.0 correspond to detected anomalies.

Parameters:
  • report (AnomalyReport)

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.anomaly_plots.plot_anomaly_heatmap(ts, reports, *, ax=None, title=None, figsize=None)[source]

Multi-method anomaly agreement heatmap.

Rows = detection methods; columns = time positions. Cells are 1 (anomaly detected) or 0 (normal). Persistent vertical columns indicate high-agreement anomalies.

Parameters:
Return type:

matplotlib.figure.Figure

Changepoint Plots

tseda.visualization.changepoint_plots.plot_changepoints(ts, report, *, ax=None, title=None, figsize=None)[source]

Line plot of ts with vertical dashed lines at each changepoint.

Parameters:
Return type:

matplotlib.figure.Figure

tseda.visualization.changepoint_plots.plot_cusum(ts, report, *, ax=None, title=None, figsize=None)[source]

CUSUM score chart from a ChangepointReport.

Plots the normalised CUSUM scores stored in report.scores and marks changepoint positions with vertical lines.

Parameters:
Return type:

matplotlib.figure.Figure

tseda.visualization.changepoint_plots.plot_segment_means(ts, report, *, ax=None, title=None, figsize=None)[source]

Series with a step-function overlay of per-segment means.

Each segment (between consecutive changepoints) is annotated with its sample mean drawn as a horizontal line.

Parameters:
Return type:

matplotlib.figure.Figure

Quality Plots

tseda.visualization.quality_plots.plot_missing_heatmap(ts, *, ax=None, title=None, figsize=None)[source]

NaN positions displayed as a binary heatmap.

For long series the observations are binned into columns to keep the plot readable. Rows represent equal-sized chunks of the series; each cell is red if any NaN is present in that chunk, white otherwise.

Parameters:
  • ts (TimeSeries)

  • ax (optional)

  • title (optional)

  • figsize (optional)

Return type:

matplotlib.figure.Figure

tseda.visualization.quality_plots.plot_outliers(ts, report, *, ax=None, title=None, figsize=None)[source]

Series line plot with IQR fence lines and outlier markers.

Parameters:
Return type:

matplotlib.figure.Figure

tseda.visualization.quality_plots.plot_outlier_score(ts, report, *, ax=None, title=None, figsize=None)[source]

Outlier score timeline with a threshold reference line at 1.0.

Parameters:
Return type:

matplotlib.figure.Figure