Logo

statsmodels.graphics.tsaplots.plotacf

statsmodels.graphics.tsaplots.plotacf(corr, ax=None, lags=None, use_vlines=True, **kwargs)[source]

Plot the auto or cross correlation.

Plots lags on the horizontal and the correlations on vertical axis.

Parameters:

corr : array_like

Array of correlation values, used on the vertical axis.

ax : Matplotlib AxesSubplot instance, optional

If given, this subplot is used to plot in instead of a new figure being created.

lags : array_like, optional

Array of lag values, used on horizontal axis. If not given, lags=np.arange(len(corr)) is used.

use_vlines : bool, optional

If True, vertical lines and markers are plotted. If False, only markers are plotted. The default marker is ‘o’; it can be overridden with a marker kwarg.

**kwargs : kwargs, optional

Optional keyword arguments that are directly passed on to the Matplotlib plot and axhline functions.

Returns:

fig : Matplotlib figure instance

If ax is None, the created figure. Otherwise the figure to which ax is connected.

See also

matplotlib.pyplot.xcorr, matplotlib.pyplot.acorr, mpl_examples

Notes

Adapted from matplotlib’s xcorr.

Data are plotted as plot(lags, corr, **kwargs)

Previous topic

statsmodels.graphics.regressionplots.plot_ccpr

Next topic

statsmodels.graphics.factorplots.interaction_plot

This Page