Skip to content

Commit d21c535

Browse files
committed
only annotate peaks if peak present
1 parent 19f82a4 commit d21c535

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fooof/plts/annotate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def plot_annotated_model(fm, plt_log=False, annotate_peaks=True, annotate_aperio
133133
# See: https://github.com/matplotlib/matplotlib/issues/12820. Fixed in 3.2.1.
134134
bug_buff = 0.000001
135135

136-
if annotate_peaks:
136+
if annotate_peaks and fm.n_peaks_:
137137

138138
# Extract largest peak, to annotate, grabbing gaussian params
139139
gauss = get_band_peak_fm(fm, fm.freq_range, attribute='gaussian_params')

0 commit comments

Comments
 (0)