From dcc11c4f382a9e02d0eddbd9c563676ae0bdf65e Mon Sep 17 00:00:00 2001 From: Dmitri Gavrilov Date: Sat, 8 Jun 2024 20:14:29 -0400 Subject: [PATCH] FIX: replaced deprecated BrokenBarHCollection with PolyCollection --- pyxrf/model/lineplot.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pyxrf/model/lineplot.py b/pyxrf/model/lineplot.py index f3c961d7..ac983343 100644 --- a/pyxrf/model/lineplot.py +++ b/pyxrf/model/lineplot.py @@ -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 @@ -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) @@ -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() @@ -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) @@ -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)