@@ -1689,7 +1689,6 @@ def xcorr(self, x, y, normed=True, detrend=mlab.detrend_none,
1689
1689
1690
1690
Parameters
1691
1691
----------
1692
-
1693
1692
x : sequence of scalars of length n
1694
1693
1695
1694
y : sequence of scalars of length n
@@ -1743,10 +1742,10 @@ def xcorr(self, x, y, normed=True, detrend=mlab.detrend_none,
1743
1742
x = detrend (np .asarray (x ))
1744
1743
y = detrend (np .asarray (y ))
1745
1744
1746
- c = np .correlate (x , y , mode = 2 )
1745
+ correls = np .correlate (x , y , mode = 2 )
1747
1746
1748
1747
if normed :
1749
- c /= np .sqrt (np .dot (x , x ) * np .dot (y , y ))
1748
+ correls /= np .sqrt (np .dot (x , x ) * np .dot (y , y ))
1750
1749
1751
1750
if maxlags is None :
1752
1751
maxlags = Nx - 1
@@ -1756,18 +1755,19 @@ def xcorr(self, x, y, normed=True, detrend=mlab.detrend_none,
1756
1755
'positive < %d' % Nx )
1757
1756
1758
1757
lags = np .arange (- maxlags , maxlags + 1 )
1759
- c = c [Nx - 1 - maxlags :Nx + maxlags ]
1758
+ correls = correls [Nx - 1 - maxlags :Nx + maxlags ]
1760
1759
1761
1760
if usevlines :
1762
- a = self .vlines (lags , [0 ], c , ** kwargs )
1761
+ a = self .vlines (lags , [0 ], correls , ** kwargs )
1762
+ # Make label empty so only vertical lines get a legend entry
1763
+ kwargs ['label' ] = ''
1763
1764
b = self .axhline (** kwargs )
1764
1765
else :
1765
-
1766
1766
kwargs .setdefault ('marker' , 'o' )
1767
1767
kwargs .setdefault ('linestyle' , 'None' )
1768
- a , = self .plot (lags , c , ** kwargs )
1768
+ a , = self .plot (lags , correls , ** kwargs )
1769
1769
b = None
1770
- return lags , c , a , b
1770
+ return lags , correls , a , b
1771
1771
1772
1772
#### Specialized plotting
1773
1773
0 commit comments