nbagg close figure when removed from dom · Issue #4841 · matplotlib/matplotlib · GitHub
Skip to content

nbagg close figure when removed from dom #4841

Description

@tacaswell

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions