diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py index d641a54abfda..c061951464d6 100644 --- a/lib/matplotlib/widgets.py +++ b/lib/matplotlib/widgets.py @@ -1473,6 +1473,7 @@ def new_axes(self, ax): transform=trans, visible=False, **self.rectprops) + self.stay_rect.set_animated(False) self.ax.add_patch(self.stay_rect) self.ax.add_patch(self.rect) @@ -1487,7 +1488,10 @@ def _press(self, event): self.rect.set_visible(self.visible) if self.span_stays: self.stay_rect.set_visible(False) - + # really force a draw so that the stay rect is not in + # the blit background + if self.useblit: + self.canvas.draw() xdata, ydata = self._get_data(event) if self.direction == 'horizontal': self.pressv = xdata @@ -1510,7 +1514,7 @@ def _release(self, event): self.stay_rect.set_height(self.rect.get_height()) self.stay_rect.set_visible(True) - self.canvas.draw() + self.canvas.draw_idle() vmin = self.pressv xdata, ydata = self._get_data(event) if self.direction == 'horizontal':