From fa57de005cf4653140fd482e057dbb979fdbfda5 Mon Sep 17 00:00:00 2001 From: Dmitri Gavrilov Date: Mon, 19 Aug 2024 16:49:44 -0400 Subject: [PATCH] FIX: fix for deprecated 'span_where' (replaced by 'fill_between') --- pyxrf/model/lineplot.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pyxrf/model/lineplot.py b/pyxrf/model/lineplot.py index fffadb11..504e949b 100644 --- a/pyxrf/model/lineplot.py +++ b/pyxrf/model/lineplot.py @@ -726,16 +726,15 @@ def plot_selected_energy_range_original(self, *, e_low=None, e_high=None): # Remove the plot if it exists if self.plot_energy_barh in self._ax.collections: self.plot_energy_barh.remove() - 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._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 ) - self._ax.add_collection(self.plot_energy_barh) def plot_multi_exp_data(self): while len(self.plot_exp_list): @@ -1474,16 +1473,15 @@ def plot_selected_energy_range(self, *, axes, barh_existing, e_low=None, e_high= # Remove the plot if it exists if barh_existing in axes.collections: barh_existing.remove() - 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 # ) + #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 ) - axes.add_collection(barh_new) return barh_new