Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nbagg close figure when removed from dom #4841

Closed
tacaswell opened this issue Jul 31, 2015 · 1 comment
Closed

nbagg close figure when removed from dom #4841

tacaswell opened this issue Jul 31, 2015 · 1 comment
Milestone

Comments

@tacaswell
Copy link
Member

Register a call back on the DOM element that contains the figure so that when it is removed from the DOM it closes the figure (which if it is the last view of the figure open removes it from Gcf and starts the clean up process).

This addresses the case where users have

fig, ax = plt.subplots()
...

in a cell they keep re-executing.

attn @pelson

@tacaswell tacaswell added this to the next point release milestone Jul 31, 2015
@pelson
Copy link
Member

pelson commented Aug 3, 2015

Seems reasonable 👍. Is there anybody who can work on this?

tacaswell added a commit to tacaswell/matplotlib that referenced this issue Aug 16, 2015
 - only actually closes the figure (in the mpl sense) if all of
   the managers active comms are dead
 - closes figure when all visible copies are removed from dom
 - eliminates many of the [IPKernelApp] ERROR | No such comm: XXXX
   errors
 - may have caused a regression in figures not closing on kernel restart

closes matplotlib#4841
tacaswell added a commit to tacaswell/matplotlib that referenced this issue Aug 16, 2015
 - only actually closes the figure (in the mpl sense) if all of
   the managers active comms are dead
 - closes figure when all visible copies are removed from dom
 - eliminates many of the [IPKernelApp] ERROR | No such comm: XXXX
   errors

closes matplotlib#4841
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants