diff --git a/lumicks/pylake/force_calibration/power_spectrum.py b/lumicks/pylake/force_calibration/power_spectrum.py index bfc720d0f..529aa240d 100644 --- a/lumicks/pylake/force_calibration/power_spectrum.py +++ b/lumicks/pylake/force_calibration/power_spectrum.py @@ -361,7 +361,7 @@ def with_spectrum(self, power) -> "PowerSpectrum": total_samples_used=self.total_samples_used, ) - def plot(self, **kwargs): + def plot(self, *, show_excluded=False, **kwargs): """Plot power spectrum Parameters @@ -371,6 +371,11 @@ def plot(self, **kwargs): """ import matplotlib.pyplot as plt + if show_excluded: + plt.plot(self.unfiltered_frequency, self.unfiltered_power) + for f_min, f_max in self._excluded_ranges: + plt.axvspan(f_min, f_max, alpha=0.1, label="_") + plt.plot(self.frequency, self.power, **kwargs) plt.xlabel("Frequency [Hz]") plt.ylabel(f"Power [${self.unit}^2/Hz$]")