plot_lags#

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

Plot one or more lagged versions of a time series.

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 sktime.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]) # plots of y(t) with y(t-1),y(t-2)..