Skip to content

Commit

Permalink
FIX: fix for deprecated 'span_where' (replaced by 'fill_between')
Browse files Browse the repository at this point in the history
  • Loading branch information
dmgav committed Aug 19, 2024
1 parent 88310e1 commit fa57de0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pyxrf/model/lineplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit fa57de0

Please sign in to comment.