Skip to content

Commit

Permalink
Fix axvspan.set_xy call in RangeMouseMode for matplotlib 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
dhomeier committed Jul 16, 2024
1 parent 41648ca commit 2b552c2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions glue_qt/viewers/profile/mouse_mode.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from echo import CallbackProperty, delay_callback
from glue.core.state_objects import State
from glue.viewers.matplotlib.mouse_mode import MouseMode
from matplotlib.patches import Rectangle

__all__ = ['NavigateMouseMode', 'RangeMouseMode']

Expand Down Expand Up @@ -155,11 +156,12 @@ def _update_artist(self, *args):
else:
self._lines[0].set_data([self.state.x_min, self.state.x_min], [0, 1])
self._lines[1].set_data([self.state.x_max, self.state.x_max], [0, 1])
self._interval.set_xy([[self.state.x_min, 0],
[self.state.x_min, 1],
[self.state.x_max, 1],
[self.state.x_max, 0],
[self.state.x_min, 0]])
if isinstance(self._interval, Rectangle):
self._interval.set_xy([self.state.x_min, self.state.x_max])
else:
self._interval.set_xy([[self.state.x_min, 0], [self.state.x_min, 1],
[self.state.x_max, 1], [self.state.x_max, 0],
[self.state.x_min, 0]])
else:
if self.state.x_min is not None and self.state.x_max is not None:
self._lines = (self._axes.axvline(self.state.x_min, color=COLOR),
Expand Down

0 comments on commit 2b552c2

Please sign in to comment.