Skip to content

Commit

Permalink
fix up start_val and ts_range
Browse files Browse the repository at this point in the history
  • Loading branch information
TomDonoghue committed Feb 15, 2024
1 parent 6ce3df2 commit 6ac7c0f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions neurodsp/plts/combined.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

@savefig
def plot_timeseries_and_spectrum(sig, fs, ts_range=None, f_range=None, spectrum_kwargs=None,
start_val=None, ts_kwargs=None, psd_kwargs=None, **plt_kwargs):
start_val=0., ts_kwargs=None, psd_kwargs=None, **plt_kwargs):
"""Plot a timeseries together with it's associated power spectrum.
Parameters
Expand Down Expand Up @@ -57,8 +57,10 @@ def plot_timeseries_and_spectrum(sig, fs, ts_range=None, f_range=None, spectrum_
ax1 = fig.add_axes([0.0, 0.6, 1.3, 0.5])
ax2 = fig.add_axes([1.5, 0.6, 0.6, 0.5])

if ts_range:
ts_kwargs['xlim'] = ts_range
times = create_times(len(sig) / fs, fs, start_val=start_val)
plot_time_series(times, sig, xlim=ts_range, ax=ax1, **plt_kwargs,
plot_time_series(times, sig, ax=ax1, **plt_kwargs,
**ts_kwargs if ts_kwargs else {})

freqs, psd = compute_spectrum(sig, fs, **spectrum_kwargs if spectrum_kwargs else {})
Expand Down

0 comments on commit 6ac7c0f

Please sign in to comment.