pandas.plotting.lag_plot

pandas 3.1.1 · Plotting · function

Plot observations against earlier observations to reveal serial patterns.

Call syntax

pd.plotting.lag_plot(series, lag=1, ax=None, **kwds)

Inspect the call

Run this code to inspect the callable and its parameters. Its data, backend, or environment is needed to execute the operation itself.

Parameters

ParameterRequirementAccepted values and behavior
series Required
Positional or keyword
Series

Provide the one-dimensional input data.

lag Optional
Positional or keyword
Default 1
int
ax Optional
Positional or keyword
Default None
Matplotlib axis object

Provide the existing Matplotlib axes on which to draw.

**kwds Optional
Additional keyword arguments

Returns

matplotlib.axes.Axes

Example for a local Python session

import pandas as pd
import matplotlib
values = pd.Series([2., 5., 7.], name="units")
print(pd.plotting.lag_plot(values))