Lag plot for time series.
The time series to visualize.
Lag length of the scatter plot.
The matplotlib axis object to use.
Matplotlib scatter method keyword arguments.
Examples
Lag plots are most commonly used to look for patterns in time series data.
Given the following time series
>>> np.random.seed(5)
>>> x = np.cumsum(np.random.normal(loc=1, scale=5, size=50))
>>> s = pd.Series(x)
>>> s.plot()
A lag plot with lag=1 returns
>>> pd.plotting.lag_plot(s, lag=1)
<Axes: xlabel='y(t)', ylabel='y(t + 1)'>
© 2008–2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
© 2011–2025, Open source contributors
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/2.3.0/reference/api/pandas.plotting.lag_plot.html