MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / acorr

Method acorr

lib/matplotlib/axes/_axes.py:1950–2021  ·  view source on GitHub ↗

Plot the autocorrelation of *x*. Parameters ---------- x : array-like Not run through Matplotlib's unit conversion, so this should be a unit-less array. detrend : callable, default: `.mlab.detrend_none` (no detrending) A

(self, x, **kwargs)

Source from the content-addressed store, hash-verified

1948
1949 @_preprocess_data(replace_names=["x"], label_namer="x")
1950 def acorr(self, x, **kwargs):
1951 """
1952 Plot the autocorrelation of *x*.
1953
1954 Parameters
1955 ----------
1956 x : array-like
1957 Not run through Matplotlib's unit conversion, so this should
1958 be a unit-less array.
1959
1960 detrend : callable, default: `.mlab.detrend_none` (no detrending)
1961 A detrending function applied to *x*. It must have the
1962 signature ::
1963
1964 detrend(x: np.ndarray) -> np.ndarray
1965
1966 normed : bool, default: True
1967 If ``True``, input vectors are normalised to unit length.
1968
1969 usevlines : bool, default: True
1970 Determines the plot style.
1971
1972 If ``True``, vertical lines are plotted from 0 to the acorr value
1973 using `.Axes.vlines`. Additionally, a horizontal line is plotted
1974 at y=0 using `.Axes.axhline`.
1975
1976 If ``False``, markers are plotted at the acorr values using
1977 `.Axes.plot`.
1978
1979 maxlags : int, default: 10
1980 Number of lags to show. If ``None``, will return all
1981 ``2 * len(x) - 1`` lags.
1982
1983 Returns
1984 -------
1985 lags : array (length ``2*maxlags+1``)
1986 The lag vector.
1987 c : array (length ``2*maxlags+1``)
1988 The auto correlation vector.
1989 line : `.LineCollection` or `.Line2D`
1990 `.Artist` added to the Axes of the correlation:
1991
1992 - `.LineCollection` if *usevlines* is True.
1993 - `.Line2D` if *usevlines* is False.
1994 b : `~matplotlib.lines.Line2D` or None
1995 Horizontal line at 0 if *usevlines* is True
1996 None *usevlines* is False.
1997
1998 Other Parameters
1999 ----------------
2000 linestyle : `~matplotlib.lines.Line2D` property, optional
2001 The linestyle for plotting the data points.
2002 Only used if *usevlines* is ``False``.
2003
2004 marker : str, default: 'o'
2005 The marker for plotting the data points.
2006 Only used if *usevlines* is ``False``.
2007

Callers 4

acorrFunction · 0.80
test_acorrFunction · 0.80
test_acorr_integersFunction · 0.80

Calls 1

xcorrMethod · 0.95

Tested by 2

test_acorrFunction · 0.64
test_acorr_integersFunction · 0.64