8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bf6bb31 commit 9cec214Copy full SHA for 9cec214
lib/matplotlib/widgets.py
@@ -2128,10 +2128,16 @@ def clear(self, event):
2128
2129
def _clear(self, event):
2130
"""Clear the cursor."""
2131
- if self.ignore(event) or self.canvas is not self.ax.figure.canvas:
+ if self.ignore(event):
2132
return
2133
if self.useblit:
2134
for canvas, info in self._canvas_infos.items():
2135
+ # someone has switched the canvas on us! This happens if
2136
+ # `savefig` needs to save to a format the previous backend did
2137
+ # not support (e.g. saving a figure using an Agg based backend
2138
+ # saved to a vector format).
2139
+ if canvas is not canvas.figure.canvas:
2140
+ continue
2141
info["background"] = canvas.copy_from_bbox(canvas.figure.bbox)
2142
2143
onmove = _api.deprecate_privatize_attribute('3.7')
0 commit comments