Title: `close_event` deprecated warning. · Issue #24602 · matplotlib/matplotlib · GitHub
Open Graph Title: `close_event` deprecated warning. · Issue #24602 · matplotlib/matplotlib
X Title: `close_event` deprecated warning. · Issue #24602 · matplotlib/matplotlib
Description: Bug summary The attached code gives the warning seen below. If this is intended, should not the close documentation include such a warning too? If not, is there a quick workaround to ignore this warning? Code for reproduction import matp...
Open Graph Description: Bug summary The attached code gives the warning seen below. If this is intended, should not the close documentation include such a warning too? If not, is there a quick workaround to ignore this wa...
X Description: Bug summary The attached code gives the warning seen below. If this is intended, should not the close documentation include such a warning too? If not, is there a quick workaround to ignore this wa...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/24602
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`close_event` deprecated warning.","articleBody":"### Bug summary\n\nThe attached code gives the warning seen below. \r\n\r\nIf this is intended, should not the `close` [documentation](https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.close.html) include such a warning too?\r\nIf not, is there a quick workaround to ignore this warning?\r\n\n\n### Code for reproduction\n\n```python\nimport matplotlib.pyplot as plt \r\nimport mpl_toolkits.mplot3d.axes3d as axes3d \r\nimport numpy as np \r\n \r\ndef plot_sphere(): \r\n \r\n # Spherical grid. \r\n th = np.linspace(0., np.pi, 100) \r\n ph = np.linspace(0., 2. * np.pi, 300) \r\n theta, phi = np.meshgrid(th, ph) \r\n \r\n # Plot sphere. \r\n x_sphere = np.sin(theta) * np.cos(phi) \r\n y_sphere = np.sin(theta) * np.sin(phi) \r\n z_sphere = np.cos(theta) \r\n \r\n fig = plt.figure() \r\n ax = fig.add_subplot(1, 1, 1, projection='3d') \r\n ax.plot_surface(x_sphere, y_sphere, z_sphere, color='blue') \r\n plt.savefig(\"Test.pdf\", bbox_inches=\"tight\") \r\n plt.close(fig) \r\n \r\n \r\ndef run(): \r\n plot_sphere() \r\n \r\n \r\nrun()\n```\n\n\n### Actual outcome\n\n```\r\nMatplotlibDeprecationWarning: The close_event function was deprecated in Matplotlib 3.6 and will be removed two minor releases later. Use callbacks.process('close_event', CloseEvent(...)) instead.\r\n```\n\n### Expected outcome\n\nNo warning.\n\n### Additional information\n\n_No response_\n\n### Operating system\n\nUbuntu 22\n\n### Matplotlib Version\n\n3.6.2\n\n### Matplotlib Backend\n\nGTK4Agg\n\n### Python version\n\n3.10\n\n### Jupyter version\n\n_No response_\n\n### Installation\n\npip","author":{"url":"https://github.com/carmaza","@type":"Person","name":"carmaza"},"datePublished":"2022-12-03T19:36:21.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/24602/matplotlib/issues/24602"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a2e17b66-20a1-8878-29d1-bebee8d43959 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9C6E:B6C89:ABC607F:F0E1BE1:6A50EC48 |
| html-safe-nonce | e56dc005c14e1734cb5939495f3eddbb96d8cc0f0a6b9c6ce0c2bd223394397d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QzZFOkI2Qzg5OkFCQzYwN0Y6RjBFMUJFMTo2QTUwRUM0OCIsInZpc2l0b3JfaWQiOiI1NTIyNDgyOTAxMDM0MjY1NjcyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 27f3cc0264de66f5cfa75f8f8d9fa9dee00bb726954112a3b7841019e1fac0d8 |
| hovercard-subject-tag | issue:1474211147 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/24602/issue_layout |
| twitter:image | https://opengraph.githubassets.com/30e5ecf9c10f20e626bbabe6b80ebd9689d96dce277892b57629c2cc0fd3a77e/matplotlib/matplotlib/issues/24602 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/30e5ecf9c10f20e626bbabe6b80ebd9689d96dce277892b57629c2cc0fd3a77e/matplotlib/matplotlib/issues/24602 |
| og:image:alt | Bug summary The attached code gives the warning seen below. If this is intended, should not the close documentation include such a warning too? If not, is there a quick workaround to ignore this wa... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | carmaza |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5266e58c17a510c403505cc811606465e90a881d2007ee7df1c4800d5c659838 |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5ec60191a48933536a90c8a19f47142fcd0d4739 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width