8000 Fix noverlap kwarg documentation for the PSD-related functions. Fix … · matplotlib/matplotlib@e912826 · GitHub
[go: up one dir, main page]

Skip to content

Commit e912826

Browse files
committed
Fix noverlap kwarg documentation for the PSD-related functions. Fix specgram return information. Fixes #840.
1 parent c0ee100 commit e912826

File tree

2 files changed

+33
-5
lines changed

2 files changed

+33
-5
lines changed

lib/matplotlib/axes.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8218,6 +8218,10 @@ def psd(self, x, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
82188218
82198219
%(PSD)s
82208220
8221+
*noverlap*: integer
8222+
The number of points of overlap between blocks. The default value
8223+
is 0 (no overlap).
8224+
82218225
*Fc*: integer
82228226
The center frequency of *x* (defaults to 0), which offsets
82238227
the x extents of the plot to reflect the frequency range used
@@ -8295,6 +8299,10 @@ def csd(self, x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
82958299
82968300
%(PSD)s
82978301
8302+
*noverlap*: integer
8303+
The number of points of overlap between blocks. The
8304+
default value is 0 (no overlap).
8305+
82988306
*Fc*: integer
82998307
The center frequency of *x* (defaults to 0), which offsets
83008308
the x extents of the plot to reflect the frequency range used
@@ -8361,6 +8369,10 @@ def cohere(self, x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
83618369
83628370
%(PSD)s
83638371
8372+
*noverlap*: integer
8373+
The number of points of overlap between blocks. The
8374+
default value is 0 (no overlap).
8375+
83648376
*Fc*: integer
83658377
The center frequency of *x* (defaults to 0), which offsets
83668378
the x extents of the plot to reflect the frequency range used
@@ -8421,6 +8433,10 @@ def specgram(self, x, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
84218433
84228434
%(PSD)s
84238435
8436+
*noverlap*: integer
8437+
The number of points of overlap between blocks. The
8438+
default value is 128.
8439+
84248440
*Fc*: integer
84258441
The center frequency of *x* (defaults to 0), which offsets
84268442
the y extents of the plot to reflect the frequency range used
@@ -8445,7 +8461,7 @@ def specgram(self, x, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
84458461
84468462
- *bins* are the time points the spectrogram is calculated over
84478463
- *freqs* is an array of frequencies
8448-
- *Pxx* is a len(times) x len(freqs) array of power
8464+
- *Pxx* is an array of shape `(len(times), len(freqs))` of power
84498465
- *im* is a :class:`~matplotlib.image.AxesImage` instance
84508466
84518467
Note: If *x* is real (i.e. non-complex), only the positive

lib/matplotlib/mlab.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,6 @@ def _spectral_helper(x, y, NFFT=256, Fs=2, detrend=detrend_none,
332332
argument, it must take a data segment as an argument and
333333
return the windowed version of the segment.
334334
335-
*noverlap*: integer
336-
The number of points of overlap between blocks. The default value
337-
is 0 (no overlap).
338-
339335
*pad_to*: integer
340336
The number of points to which the data segment is padded when
341337
performing the FFT. This can be different from *NFFT*, which
@@ -377,6 +373,10 @@ def psd(x, NFFT=256, Fs=2, detrend=detrend_none, window=window_hanning,
377373
378374
%(PSD)s
379375
376+
*noverlap*: integer
377+
The number of points of overlap between blocks. The default value
378+
is 0 (no overlap).
379+
380380
Returns the tuple (*Pxx*, *freqs*).
381381
382382
Refs:
@@ -409,6 +409,10 @@ def csd(x, y, NFFT=256, Fs=2, detrend=detrend_none, window=window_hanning,
409409
410410
%(PSD)s
411411
412+
*noverlap*: integer
413+
The number of points of overlap between blocks. The default value
414+
is 0 (no overlap).
415+
412416
Returns the tuple (*Pxy*, *freqs*).
413417
414418
Refs:
@@ -437,6 +441,10 @@ def specgram(x, NFFT=256, Fs=2, detrend=detrend_none, window=window_hanning,
437441
438442
%(PSD)s
439443
444+
*noverlap*: integer
445+
The number of points of overlap between blocks. The default value
446+
is 128.
447+
440448
Returns a tuple (*Pxx*, *freqs*, *t*):
441449
442450
- *Pxx*: 2-D array, columns are the periodograms of
@@ -482,6 +490,10 @@ def cohere(x, y, NFFT=256, Fs=2, detrend=detrend_none, window=window_hanning,
482490
483491
%(PSD)s
484492
493+
*noverlap*: integer
494+
The number of points of overlap between blocks. The default value
495+
is 0 (no overlap).
496+
485497
The return value is the tuple (*Cxy*, *f*), where *f* are the
486498
frequencies of the coherence vector. For cohere, scaling the
487499
individual densities by the sampling frequency has no effect,

0 commit comments

Comments
 (0)
0