xcorr(x, y, normed=True, detrend=<function detrend_none at 0x0000000>, usevlines=True, maxlags=10, *, data=None, **kwargs)
The correlation with lag k is defined as $\sum_n x[n+k] \cdot y^*[n]$ , where $y^*$ is the complex conjugate of $y$ .
The cross correlation is performed with numpy.correlate
with mode = "full"
.
The linestyle for plotting the data points. Only used if usevlines is False
.
The marker for plotting the data points. Only used if usevlines is False
.
If given, the following parameters also accept a string s
, which is interpreted as data[s]
(unless this raises an exception):
x, y
Additional parameters are passed to .Axes.vlines
and .Axes.axhline
if usevlines is True
; otherwise they are passed to .Axes.plot
.
A detrending function applied to x and y. It must have the signature :
detrend(x: np.ndarray) -> np.ndarray
If True
, input vectors are normalised to unit length.
Determines the plot style.
If True
, vertical lines are plotted from 0 to the xcorr value using .Axes.vlines
. Additionally, a horizontal line is plotted at y=0 using .Axes.axhline
.
If False
, markers are plotted at the xcorr values using .Axes.plot
.
Number of lags to show. If None, will return all 2 * len(x) - 1
lags.
The lag vector.
The auto correlation vector.
.Artist
added to the Axes of the correlation:
.LineCollection
if usevlines is True.
.Line2D
if usevlines is False.
Horizontal line at 0 if usevlines is True None usevlines is False.
Plot the cross correlation between x and y.
The following pages refer to to this document either explicitly or contain code examples using this.
matplotlib.pyplot.plotting
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them