diff --git a/pyxrf/model/lineplot.py b/pyxrf/model/lineplot.py index 53a8770c..013a6ba6 100644 --- a/pyxrf/model/lineplot.py +++ b/pyxrf/model/lineplot.py @@ -728,13 +728,13 @@ def plot_selected_energy_range_original(self, *, e_low=None, e_high=None): self.plot_energy_barh.remove() # Create the new plot (based on new parameters if necessary - self.plot_energy_barh = PolyCollection.span_where( - x_v, ymin=y_min, ymax=y_max, where=ss, facecolor="white", edgecolor="yellow", alpha=1 - ) - # self.plot_energy_barh = self._ax.fill_between( - # x_v, y1=y_min, y2=y_max, where=ss, facecolor="white", edgecolor="yellow", alpha=1 + # self.plot_energy_barh = PolyCollection.span_where( + # x_v, ymin=y_min, ymax=y_max, where=ss, facecolor="white", edgecolor="yellow", alpha=1 # ) - self._ax.add_collection(self.plot_energy_barh) + # self._ax.add_collection(self.plot_energy_barh) + self.plot_energy_barh = self._ax.fill_between( + x_v, y1=y_min, y2=y_max, where=ss, facecolor="white", edgecolor="yellow", alpha=1 + ) def plot_multi_exp_data(self): while len(self.plot_exp_list): @@ -1475,13 +1475,13 @@ def plot_selected_energy_range(self, *, axes, barh_existing, e_low=None, e_high= barh_existing.remove() # Create the new plot (based on new parameters if necessary - barh_new = PolyCollection.span_where( - x_v, ymin=y_min, ymax=y_max, where=ss, facecolor="white", edgecolor="yellow", alpha=1 - ) - # barh_new = axes.fill_between( - # x_v, y1=y_min, y2=y_max, where=ss, facecolor="white", edgecolor="yellow", alpha=1 + # barh_new = PolyCollection.span_where( + # x_v, ymin=y_min, ymax=y_max, where=ss, facecolor="white", edgecolor="yellow", alpha=1 # ) - axes.add_collection(barh_new) + # axes.add_collection(barh_new) + barh_new = axes.fill_between( + x_v, y1=y_min, y2=y_max, where=ss, facecolor="white", edgecolor="yellow", alpha=1 + ) return barh_new