plot_lags

plot_lags(series, lags=1, suptitle=None)[source]

Plot one or more lagged versions of a time series.

A lag plot is a scatter plot of a time series against a lag of itself. It is normally used to check for autocorrelation.

Parameters:
seriespd.Series

Time series for plotting lags.

lagsint or array-like, default=1

The lag or lags to plot.

  • int plots the specified lag

  • array-like plots specified lags in the array/list

suptitlestr, default=None

The text to use as the Figure’s suptitle. If None, then the title will be “Plot of series against lags {lags}”

Returns:
figmatplotlib.figure.Figure
axesnp.ndarray

Array of the figure’s Axe objects

Examples

>>> from aeon.visualisation import plot_lags
>>> from aeon.datasets import load_airline
>>> y = load_airline()
>>> fig, ax = plot_lags(y, lags=2) # plot of y(t) with y(t-2)  
>>> fig, ax = plot_lags(y, lags=[1,2,3]) # y(t) & y(t-1), y(t-2)..