Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Close widget when figure is closed from python #5

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

Merged
merged 1 commit into from
Sep 2, 2016

Conversation

jenshnielsen
Copy link
Member

@jenshnielsen jenshnielsen commented Sep 2, 2016

This ensures that the figure in the notebook is closed correctly when closed

I.e.

plt.plot(range(10))

creates a figure and then in a new cell assuming this is the first figure we can close it with:

plt.close(1)

Currently this does not have any visual effect. This change ensures that the figure is closed in the notebook as expected.

I have removed the self._send_event('close') because it seems to trigger a no comms warning. As I understand it this no longer needed anyway as the widget handles the closing.

@SylvainCorlay
Copy link
Member

This looks good to me.

@SylvainCorlay SylvainCorlay merged commit e70968e into matplotlib:master Sep 2, 2016
@jenshnielsen jenshnielsen deleted the close_from_python branch September 2, 2016 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants