From 016f64467211478b7ce5c8c9d099a808ea94750d Mon Sep 17 00:00:00 2001 From: gitj Date: Mon, 12 Nov 2012 15:49:21 -0500 Subject: [PATCH 1/2] Update documentation of specgram Mention that plotted data is in dB --- lib/matplotlib/axes.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/axes.py b/lib/matplotlib/axes.py index ff7187b79740..6530b085c7a0 100644 --- a/lib/matplotlib/axes.py +++ b/lib/matplotlib/axes.py @@ -8573,11 +8573,12 @@ def specgram(self, x, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none, cmap=None, xextent=None, pad_to=None, sides='default', scale_by_freq=None, **kwargs) - Compute a spectrogram of data in *x*. Data are split into + Compute and plot a spectrogram of data in *x*. Data are split into *NFFT* length segments and the PSD of each section is computed. The windowing function *window* is applied to each segment, and the amount of overlap of each segment is - specified with *noverlap*. + specified with *noverlap*. The spectrogram is plotted in decibels + as a colormap (using imshow). %(PSD)s From 930a9dbd9136120fcdd65c4c77186b393d5bd13b Mon Sep 17 00:00:00 2001 From: gitj Date: Tue, 13 Nov 2012 14:59:47 -0500 Subject: [PATCH 2/2] DOC: Update return value units in specgram --- lib/matplotlib/axes.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/matplotlib/axes.py b/lib/matplotlib/axes.py index 6530b085c7a0..754b8c05f7c1 100644 --- a/lib/matplotlib/axes.py +++ b/lib/matplotlib/axes.py @@ -8617,6 +8617,9 @@ def specgram(self, x, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none, spectrum is shown. If *x* is complex, both positive and negative parts of the spectrum are shown. This can be overridden using the *sides* keyword argument. + + Also note that while the plot is in dB, the *Pxx* array returned is + linear in power. **Example:**