Title: [Bug]: `check_figures_equal` decorator doesn't respect new figure properties set in test · Issue #24875 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: `check_figures_equal` decorator doesn't respect new figure properties set in test · Issue #24875 · matplotlib/matplotlib
X Title: [Bug]: `check_figures_equal` decorator doesn't respect new figure properties set in test · Issue #24875 · matplotlib/matplotlib
Description: Bug summary We use the check_figures_equal in testing to compare figures. This decorator uses two figure instances fig_test and fig_ref for comparison. If we set any figure properties (like facecolor) in the test, they don't seem to be p...
Open Graph Description: Bug summary We use the check_figures_equal in testing to compare figures. This decorator uses two figure instances fig_test and fig_ref for comparison. If we set any figure properties (like facecol...
X Description: Bug summary We use the check_figures_equal in testing to compare figures. This decorator uses two figure instances fig_test and fig_ref for comparison. If we set any figure properties (like facecol...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/24875
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: `check_figures_equal` decorator doesn't respect new figure properties set in test","articleBody":"### Bug summary\r\n\r\nWe use the `check_figures_equal` in testing to compare figures. This decorator uses two figure instances `fig_test` and `fig_ref` for comparison. If we set any figure properties (like `facecolor`) in the test, they don't seem to be propagated when saving the actual figure.\r\n\r\nRan into this while writing a test for #24816 (cc @anntzer, for reference)\r\n\r\n### Code for reproduction\r\n\r\n```python\r\n@check_figures_equal(extensions=[\"png\"])\r\ndef test_test(fig_test, fig_ref):\r\n ax_test = fig_test.add_subplot()\r\n ax_test.set(xticks=[], yticks=[])\r\n fig_test.set_facecolor(\"teal\")\r\n\r\n ax_ref = fig_ref.add_subplot()\r\n ax_ref.set(xticks=[], yticks=[])\r\n fig_ref.set_facecolor(\"none\")\r\n```\r\n\r\n\r\n### Actual outcome\r\n\r\nThis test passes, which suggests that the two figures created are equal but they actually aren't since the facecolor for both figures are set to be different.\r\n\r\n### Expected outcome\r\n\r\nThis test shouldn't pass and the figures should have facecolors \"teal\" and \"none\" respectively.\r\n\r\n### Additional information\r\n\r\n_No response_\r\n\r\n### Operating system\r\n\r\nArch\r\n\r\n### Matplotlib Version\r\n\r\n3.6.0.dev1889+gc59a7fa8db.d20230103\r\n\r\n### Matplotlib Backend\r\n\r\n_No response_\r\n\r\n### Python version\r\n\r\n3.10\r\n\r\n### Jupyter version\r\n\r\n_No response_\r\n\r\n### Installation\r\n\r\nNone","author":{"url":"https://github.com/chahak13","@type":"Person","name":"chahak13"},"datePublished":"2023-01-03T19:12:39.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/24875/matplotlib/issues/24875"}
| 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:450622cf-88a7-89d2-e385-8aadda9758cd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EB4E:2804AF:5E926E:813EFC:6A5253C5 |
| html-safe-nonce | ffe9f4fc53d6e3d2e6c35f17d396bfd1cc9816fa2325190b2e656d9077698b86 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjRFOjI4MDRBRjo1RTkyNkU6ODEzRUZDOjZBNTI1M0M1IiwidmlzaXRvcl9pZCI6IjIyNDk5MDU1MDcyNTgyMjU2MDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4311e2bb57554cd7cb81bcb7a2bf05c39eaf026a1fe7a2aa6064f5363bd99ee0 |
| hovercard-subject-tag | issue:1517809324 |
| 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/24875/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a06dfca9d5dff96af4172a9a1251e5ddc9e219012e887b158ebc6239834fb9b6/matplotlib/matplotlib/issues/24875 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a06dfca9d5dff96af4172a9a1251e5ddc9e219012e887b158ebc6239834fb9b6/matplotlib/matplotlib/issues/24875 |
| og:image:alt | Bug summary We use the check_figures_equal in testing to compare figures. This decorator uses two figure instances fig_test and fig_ref for comparison. If we set any figure properties (like facecol... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | chahak13 |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width