@@ -52,6 +52,8 @@ def plot_time_model(time_model, **plot_kwargs):
5252 figsize = plot_kwargs .pop ('figsize' , [10 , 4 + 2 * n_bands ]))
5353 axes = cycle (axes )
5454
55+ xlim = [0 , time_model .n_time_windows ]
56+
5557 # 01: aperiodic parameters
5658 ap_params = [time_model .time_results ['offset' ],
5759 time_model .time_results ['exponent' ]]
@@ -63,7 +65,7 @@ def plot_time_model(time_model, **plot_kwargs):
6365 ap_labels .insert (1 , 'Knee' )
6466 ap_colors .insert (1 , PARAM_COLORS ['knee' ])
6567
66- plot_params_over_time (None , ap_params , labels = ap_labels , add_xlabel = False ,
68+ plot_params_over_time (None , ap_params , labels = ap_labels , add_xlabel = False , xlim = xlim ,
6769 colors = ap_colors , title = 'Aperiodic Parameters' , ax = next (axes ))
6870
6971 # 02: periodic parameters
@@ -73,14 +75,14 @@ def plot_time_model(time_model, **plot_kwargs):
7375 [time_model .time_results [pe_labels ['cf' ][band_ind ]],
7476 time_model .time_results [pe_labels ['pw' ][band_ind ]],
7577 time_model .time_results [pe_labels ['bw' ][band_ind ]]],
76- labels = ['CF' , 'PW' , 'BW' ], add_xlabel = False ,
78+ labels = ['CF' , 'PW' , 'BW' ], add_xlabel = False , xlim = xlim ,
7779 colors = [PARAM_COLORS ['cf' ], PARAM_COLORS ['pw' ], PARAM_COLORS ['bw' ]],
7880 title = 'Periodic Parameters - ' + band_labels [band_ind ], ax = next (axes ))
7981
8082 # 03: goodness of fit
8183 plot_params_over_time (None ,
8284 [time_model .time_results ['error' ],
8385 time_model .time_results ['r_squared' ]],
84- labels = ['Error' , 'R-squared' ],
86+ labels = ['Error' , 'R-squared' ], xlim = xlim ,
8587 colors = [PARAM_COLORS ['error' ], PARAM_COLORS ['r_squared' ]],
8688 title = 'Goodness of Fit' , ax = next (axes ))
0 commit comments