File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ def plot_single_spectrum(
9797 ) # Add vertical line
9898 for y_val in hlines :
9999 plt .axhline (
100- x = y_val , color = "red" , linestyle = "--" , label = f"Transmission (y={ y_val } )"
100+ y = y_val , color = "red" , linestyle = "--" , label = f"Transmission (y={ y_val } )"
101101 ) # Add vertical line
102102 return plt .gcf ()
103103
@@ -141,6 +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+ if hlines :
145+ y_min = min (hlines + [y_min ])* 0.95
146+ y_max = max (hlines + [y_max ])* 1.05
144147
145148 slider_index = slider_index or list (range (len (spectra [0 ])))
146149 spectrum_labels = spectrum_labels or [f"Spectrum { i } " for i in range (len (spectra ))]
@@ -159,7 +162,7 @@ def plot_array(index=0):
159162 ) # Add vertical line
160163 for y_val in hlines :
161164 plt .axhline (
162- x = y_val , color = "red" , linestyle = "--" , label = f"Transmission (y={ y_val } )"
165+ y = y_val , color = "red" , linestyle = "--" , label = f"Transmission (y={ y_val } )"
163166 ) # Add vertical line
164167 plt .title (f"Iteration: { index } " )
165168 plt .xlabel ("X" )
You can’t perform that action at this time.
0 commit comments