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

Skip to content

Commit cc753e7

Browse files
author
Stefan Mitic
committed
test: created test for specgram Fs is none
1 parent 7069072 commit cc753e7

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

lib/matplotlib/tests/test_axes.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4166,6 +4166,17 @@ def test_specgram_angle():
41664166
scale="dB")
41674167

41684168

4169+
def test_specgram_fs_none():
4170+
""" Test axes.specgram when Fs is None, should not throw error """
4171+
try:
4172+
spec, freqs, t, im = plt.specgram(np.ones(300), Fs=None)
4173+
except Exception as e:
4174+
raise pytest.fail("DID RAISE {0}".format(e))
4175+
4176+
xmin, xmax, freq0, freq1 = im.get_extent()
4177+
assert xmin == 32 and xmax == 96
4178+
4179+
41694180
@image_comparison(
41704181
["psd_freqs.png", "csd_freqs.png", "psd_noise.png", "csd_noise.png"],
41714182
remove_text=True, tol=0.002)

0 commit comments

Comments
 (0)