pandas.plotting.lag_plot
- pandas.plotting.lag_plot(series, lag=1, ax=None, **kwds)[source]
-
Lag plot for time series.
- Parameters
-
- series:Time series
- lag:lag of the scatter plot, default 1
- ax:Matplotlib axis object, optional
- **kwds
-
Matplotlib scatter method keyword arguments.
- Returns
-
- class:matplotlib.axis.Axes
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)
© 2008–2021, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/1.3.4/reference/api/pandas.plotting.lag_plot.html