99@plot_test
1010def test_plot_spectrum (tfm , skip_if_no_mpl ):
1111
12- plot_spectrum (tfm .freqs , tfm .power_spectrum , True )
12+ plot_spectrum (tfm .freqs , tfm .power_spectrum )
13+
14+ # Test with logging both axes
15+ plot_spectrum (tfm .freqs , tfm .power_spectrum , True , True )
1316
1417@plot_test
1518def test_plot_spectra (tfg , skip_if_no_mpl ):
1619
20+ # Test with 1d inputs - 1d freq array and list of 1d power spectra
1721 plot_spectra (tfg .freqs , [tfg .power_spectra [0 , :], tfg .power_spectra [1 , :]])
1822
23+ # Test with multiple freq inputs - list of 1d freq array and list of 1d power spectra
24+ plot_spectra ([tfg .freqs , tfg .freqs ], [tfg .power_spectra [0 , :], tfg .power_spectra [1 , :]])
25+
26+ # Test with 2d array inputs
27+ plot_spectra (np .vstack ([tfg .freqs , tfg .freqs ]),
28+ np .vstack ([tfg .power_spectra [0 , :], tfg .power_spectra [1 , :]]))
29+
30+ # Test with labels
31+ plot_spectra (tfg .freqs , [tfg .power_spectra [0 , :], tfg .power_spectra [1 , :]], labels = ['A' , 'B' ])
32+
1933@plot_test
2034def test_plot_spectrum_shading (tfm , skip_if_no_mpl ):
2135
@@ -26,3 +40,8 @@ def test_plot_spectra_shading(tfg, skip_if_no_mpl):
2640
2741 plot_spectra_shading (tfg .freqs , [tfg .power_spectra [0 , :], tfg .power_spectra [1 , :]],
2842 shades = [8 , 12 ], add_center = True )
43+
44+ # Test with **kwargs that pass into plot_spectra
45+ plot_spectra_shading (tfg .freqs , [tfg .power_spectra [0 , :], tfg .power_spectra [1 , :]],
46+ shades = [8 , 12 ], add_center = True , log_freqs = True , log_powers = True ,
47+ labels = ['A' , 'B' ])
0 commit comments