Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix missing parameter initialization in Axes.specgram()#16947

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
timhoffm merged 5 commits intomatplotlib:masterfromStefan-Mitic:issue/9100
Apr 2, 2020
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletionslib/matplotlib/axes/_axes.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7617,6 +7617,8 @@ def specgram(self, x, NFFT=None, Fs=None, Fc=None, detrend=None,
Fc = 0 # same default as in mlab._spectral_helper()
if noverlap is None:
noverlap = 128 # same default as in mlab.specgram()
if Fs is None:
Fs = 2 # same default as in mlab._spectral_helper()

if mode == 'complex':
raise ValueError('Cannot plot a complex specgram')
Expand Down
7 changes: 7 additions & 0 deletionslib/matplotlib/tests/test_axes.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4166,6 +4166,13 @@ def test_specgram_angle():
scale="dB")


def test_specgram_fs_none():
"""Test axes.specgram when Fs is None, should not throw error."""
spec, freqs, t, im = plt.specgram(np.ones(300), Fs=None)
xmin, xmax, freq0, freq1 = im.get_extent()
assert xmin == 32 and xmax == 96


@image_comparison(
["psd_freqs.png", "csd_freqs.png", "psd_noise.png", "csd_noise.png"],
remove_text=True, tol=0.002)
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp