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

[BUG] Agg Backend doesn't call close_event #19792

Closed
alexrockhill opened this issue Mar 27, 2021 · 3 comments
Closed

[BUG] Agg Backend doesn't call close_event #19792

alexrockhill opened this issue Mar 27, 2021 · 3 comments

Comments

@alexrockhill
Copy link

alexrockhill commented Mar 27, 2021

Bug report

Other backends properly call the close event, but it seems there is an issue with Agg specific to 3.4.

import matplotlib
import matplotlib.pyplot as plt
matplotlib.use('Agg')

def _close(event):
    print(event)


fig, ax = plt.subplots()
fig.canvas.mpl_connect('close_event', _close)
plt.close(fig)

matplotlib.use('Qt5Agg')
fig, ax = plt.subplots()
fig.canvas.mpl_connect('close_event', _close)
plt.close(fig)

Actual outcome

No call to close for Agg.

Expected outcome

Calls from both backends with print outputs.

Matplotlib version

  • Operating system: All
  • Matplotlib version (import matplotlib; print(matplotlib.__version__)): 3.4.0
  • Matplotlib backend (print(matplotlib.get_backend())):
  • Python version: ~3.8
  • Jupyter version (if applicable):
  • Other libraries:
@alexrockhill
Copy link
Author

alexrockhill commented Mar 27, 2021

@anntzer
Copy link
Contributor

anntzer commented Mar 27, 2021

Is this specific to 3.4? #18609 already discussed this at length, but that was in 3.3.

@alexrockhill
Copy link
Author

alexrockhill commented Mar 27, 2021

Huh, some tests started failing related to this after the change to 3.4 but I just checked and it was in 3.3 so I better check to see what actually changed. Thanks for the comment.

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

No branches or pull requests

2 participants