Visualise ACF, PACF, and optional CCF diagnostics with Plotly, including grouped facets and extensive styling controls. Polars DataFrames are supported (they are converted internally to pandas).
Parameters
Name
Type
Description
Default
data
pd.DataFrame or pd.core.groupby.generic.DataFrameGroupBy
Time series data or grouped data produced via DataFrame.groupby.
required
date_column
str or ColumnSelector
Name of the datetime column, or a tidy selector resolving to one column.
required
value_column
str or ColumnSelector
Numeric column to diagnose, or a tidy selector resolving to one column.
required
ccf_columns
str or sequence
Additional numeric columns whose cross-correlations should be drawn. Accepts literal names or tidy selectors from :mod:pytimetk.utils.selection.
None
lags
int, sequence, slice, or str
Lag specification forwarded to :func:pytimetk.acf_diagnostics. Defaults to 1000.
1000
show_white_noise
bool
Draw white-noise confidence bands around each subplot. Defaults to True.
True
title
str
Figure title. Defaults to "Lag Diagnostics".
'Lag Diagnostics'
x_lab
str
Axis labels for the bottom row / first column. x_lab defaults to an empty string.
''
y_lab
str
Axis labels for the bottom row / first column. x_lab defaults to an empty string.
''
width
int
Figure dimensions in pixels.
None
height
int
Figure dimensions in pixels.
None
plotly_dropdown
bool
When True and grouped data are supplied, render a single set of panels with a Plotly dropdown to switch between groups. Defaults to False.
False
plotly_dropdown_x
float
Position of the dropdown menu (only used when plotly_dropdown is True).
1.05
plotly_dropdown_y
float
Position of the dropdown menu (only used when plotly_dropdown is True).
1.05
group_ncols
int
Number of facet columns when grouped data are supplied. Defaults to a single row.
None
group_label_sep
str
Separator used when concatenating multiple group labels for facet titles.
', '
line_color
str
Colour of the ACF/PACF/CCF traces.
'#2c3e50'
line_width
float
Line width in pixels. Defaults to 2.0.
2.0
line_dash
str
Dash style for correlation lines ("solid", "dash", etc.).
'solid'
marker_color
str
Colour for scatter markers. Defaults to line_color.
None
marker_size
float
Marker size in pixels. Defaults to 6.0.
6.0
marker_symbol
str
Plotly marker symbol ("circle", "square", β¦).
'circle'
marker_line_color
str
Outline colour for markers. Defaults to marker_color.
None
marker_line_width
float
Outline width for markers. Defaults to 0.0.
0.0
show_markers
bool
Toggle markers on/off. Defaults to True.
True
show_legend
bool
Display a legend for the metric traces. Defaults to False.
False
zero_line_color
optional
Styling for the horizontal zero reference line.
'#999999'
zero_line_width
optional
Styling for the horizontal zero reference line.
'#999999'
zero_line_dash
optional
Styling for the horizontal zero reference line.
'#999999'
white_noise_color
optional
Styling for the white-noise confidence bands.
'#A6CEE3'
white_noise_dash
optional
Styling for the white-noise confidence bands.
'#A6CEE3'
white_noise_width
optional
Styling for the white-noise confidence bands.
'#A6CEE3'
hovertemplate
str
Custom Plotly hover template. Defaults to "Lag=%{x}<br>Correlation=%{y}<extra></extra>".
None
Returns
Name
Type
Description
plotly.graph_objects.Figure
A Plotly figure with one subplot per diagnostic metric (ACF, PACF, CCF traces) and optional facets for grouped series.