Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit acfa6a1

Browse files
committed
Fix buglet where y would stay as pre-asarray() version of x if they were passed in as the same object.
svn path=/trunk/matplotlib/; revision=8804
1 parent 9be2127 commit acfa6a1

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/matplotlib/mlab.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,11 @@ def _spectral_helper(x, y, NFFT=256, Fs=2, detrend=detrend_none,
212212

213213
#Make sure we're dealing with a numpy array. If y and x were the same
214214
#object to start with, keep them that way
215-
216215
x = np.asarray(x)
217216
if not same_data:
218217
y = np.asarray(y)
218+
else:
219+
y = x
219220

220221
# zero pad x and y up to NFFT if they are shorter than NFFT
221222
if len(x)<NFFT:

0 commit comments

Comments
 (0)