Skip to content

Commit 6efb9bc

Browse files
committed
🩹 Fix plot_sas with scale factor changes original data
1 parent 88f1ed5 commit 6efb9bc

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

pyglotaran_extras/plotting/plot_spectra.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ def plot_sas(
9191
):
9292
data = sas.sel(species=species)
9393
if (scale_factor := scale_factors.get(species)) is not None:
94-
data *= scale_factor
95-
data.plot.line(x="spectral", ax=ax, zorder=zorder)
94+
(data * scale_factor).plot.line(x="spectral", ax=ax, zorder=zorder)
95+
else:
96+
data.plot.line(x="spectral", ax=ax, zorder=zorder)
9697
ax.set_title(title)
9798
if show_zero_line is True:
9899
ax.axhline(0, color="k", linewidth=1)

0 commit comments

Comments
 (0)