Skip to content

Commit c1936b9

Browse files
committed
take into account hlines may be none
1 parent 63bd886 commit c1936b9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/axiomatic/pic_helpers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,9 @@ def plot_interactive_spectra(
141141
# Calculate global y-limits across all arrays
142142
y_min = min(min(min(arr2) for arr2 in arr1) for arr1 in spectra)
143143
y_max = max(max(max(arr2) for arr2 in arr1) for arr1 in spectra)
144-
y_min = min(hlines + [y_min])*0.95
145-
y_max = max(hlines + [y_max])*1.05
144+
if hlines:
145+
y_min = min(hlines + [y_min])*0.95
146+
y_max = max(hlines + [y_max])*1.05
146147

147148
slider_index = slider_index or list(range(len(spectra[0])))
148149
spectrum_labels = spectrum_labels or [f"Spectrum {i}" for i in range(len(spectra))]

0 commit comments

Comments
 (0)