Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Remove custom backend_nbagg.show(), putting logic in manager show.#23100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -96,6 +96,15 @@ def show(self): | ||
else: | ||
self.canvas.draw_idle() | ||
self._shown = True | ||
# plt.figure adds an event which makes the figure in focus the active | ||
# one. Disable this behaviour, as it results in figures being put as | ||
# the active figure after they have been shown, even in non-interactive | ||
# mode. | ||
if hasattr(self, '_cidgcf'): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Is there any way to add tests to argue that this is working as expected? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Actually, there was previously no test coverage for the corresponding old code paths (as can be checked e.g. via There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. fair. | ||
self.canvas.mpl_disconnect(self._cidgcf) | ||
if not is_interactive(): | ||
from matplotlib._pylab_helpers import Gcf | ||
Gcf.figs.pop(self.num, None) | ||
def reshow(self): | ||
""" | ||
@@ -232,27 +241,3 @@ def on_message(self, message): | ||
class _BackendNbAgg(_Backend): | ||
FigureCanvas = FigureCanvasNbAgg | ||
FigureManager = FigureManagerNbAgg | ||