Skip to content

Commit

Permalink
FIX: replaced deprecated BrokenBarHCollection with PolyCollection
Browse files Browse the repository at this point in the history
  • Loading branch information
dmgav committed Jun 9, 2024
1 parent 7ed9347 commit dcc11c4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pyxrf/model/lineplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import numpy as np
from atom.api import Atom, Bool, Dict, Float, Int, List, Str, Typed, observe
from matplotlib.axes import Axes
from matplotlib.collections import BrokenBarHCollection
from matplotlib.collections import PolyCollection
from matplotlib.colors import LogNorm
from matplotlib.figure import Figure
from matplotlib.lines import Line2D
Expand Down Expand Up @@ -122,7 +122,7 @@ class LinePlotModel(Atom):
_fig_preview = Typed(Figure)
_ax_preview = Typed(Axes)
_lines_preview = List()
_bahr_preview = Typed(BrokenBarHCollection)
_bahr_preview = Typed(PolyCollection)

plot_type_preview = Typed(PlotTypes)
energy_range_preview = Typed(EnergyRangePresets)
Expand Down Expand Up @@ -177,7 +177,7 @@ class LinePlotModel(Atom):
show_exp_opt = Bool(False) # Flag: show spectrum preview

# Reference to artist responsible for displaying the selected range of energies on the plot
plot_energy_barh = Typed(BrokenBarHCollection)
plot_energy_barh = Typed(PolyCollection)
t_bar = Typed(object)

plot_exp_list = List()
Expand Down Expand Up @@ -727,7 +727,7 @@ 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 = BrokenBarHCollection.span_where(
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)
Expand Down Expand Up @@ -1471,7 +1471,7 @@ 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 = BrokenBarHCollection.span_where(
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)
Expand Down

0 comments on commit dcc11c4

Please sign in to comment.