Skip to content

Commit ba2893e

Browse files
committed
Merge remote-tracking branch 'upstream/v1.1.x'
2 parents adf6680 + 389670a commit ba2893e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/mlab.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ def cohere_pairs( X, ij, NFFT=256, Fs=2, detrend=detrend_none,
639639
FFTSlices[iCol] = Slices
640640
if preferSpeedOverMemory:
641641
FFTConjSlices[iCol] = np.conjugate(Slices)
642-
Pxx[iCol] = np.divide(np.mean(abs(Slices)**2), normVal)
642+
Pxx[iCol] = np.divide(np.mean(abs(Slices)**2, axis=0), normVal)
643643
del Slices, ind, windowVals
644644

645645
# compute the coherences and phases for all pairs using the
@@ -657,7 +657,7 @@ def cohere_pairs( X, ij, NFFT=256, Fs=2, detrend=detrend_none,
657657
Pxy = FFTSlices[i] * FFTConjSlices[j]
658658
else:
659659
Pxy = FFTSlices[i] * np.conjugate(FFTSlices[j])
660-
if numSlices>1: Pxy = np.mean(Pxy)
660+
if numSlices>1: Pxy = np.mean(Pxy, axis=0)
661661
#Pxy = np.divide(Pxy, normVal)
662662
Pxy /= normVal
663663
#Cxy[(i,j)] = np.divide(np.absolute(Pxy)**2, Pxx[i]*Pxx[j])

0 commit comments

Comments
 (0)