diff --git a/src/gasflux/background.py b/src/gasflux/background.py index df594b6..54bf950 100644 --- a/src/gasflux/background.py +++ b/src/gasflux/background.py @@ -52,7 +52,11 @@ def algorithmic_baseline( signal = (df[gas] - bkg)[~bkg_points] df[f"{gas}_signal"] = np.invert(bkg_points) - fig = None # plotting disabled + try: + from . import plotting + fig = plotting.background_plotting(df, gas) + except Exception: + fig = None output_text = ( f"Baseline algorithm: {algorithm}\n" f"Positive and negative 95% percentile of baseline: {np.percentile(background, 2.5):.2f} ppm, "