Title: TST: Use shapes instead of actual text for layout manager tests · Issue #29825 · matplotlib/matplotlib · GitHub
Open Graph Title: TST: Use shapes instead of actual text for layout manager tests · Issue #29825 · matplotlib/matplotlib
X Title: TST: Use shapes instead of actual text for layout manager tests · Issue #29825 · matplotlib/matplotlib
Description: If we are going to go through and re-generate a lot of test images it should be coupled with an audit of if that image actually needs text in it and switching them to the new defaults. Originally posted by @tacaswell in #16447 Currently ...
Open Graph Description: If we are going to go through and re-generate a lot of test images it should be coupled with an audit of if that image actually needs text in it and switching them to the new defaults. Originally p...
X Description: If we are going to go through and re-generate a lot of test images it should be coupled with an audit of if that image actually needs text in it and switching them to the new defaults. Originally p...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/29825
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TST: Use shapes instead of actual text for layout manager tests","articleBody":"\n\u003e If we are going to go through and re-generate a lot of test images it should be coupled with an audit of if that image _actually_ needs text in it and switching them to the new defaults. \n\n _Originally posted by @tacaswell in [#16447](https://github.com/matplotlib/matplotlib/issues/16447#issuecomment-2762018705)_\n\nCurrently the layout managers main job is to avoid overwriting text between subplots on a page. They currently use image tests to check that this works, and those image tests change a fair bit if kerning or glyphs change in the font management. \n\nI think most, if not all, of these tests could be changed to replace the text with shapes. Maybe even automatically - eg instead of \"remove text\" we have \"shapify-text\", where it gets a nominal text size from rcParams and makes a nominal shape in the correct spot of the correct, but nominal, size. eg it does not use the actual size of any text elements as rendered, but says its 12-pt font, x characters, so we make a box that is 14 points by 13*x points large centered where the label should go. If these tests were made deterministic this way, then they could even possibly drop the image tests and just test the position of the axes, which is what the layout engines do.","author":{"url":"https://github.com/jklymak","@type":"Person","name":"jklymak"},"datePublished":"2025-03-28T17:58:20.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/29825/matplotlib/issues/29825"}
| 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:17d05e69-43d8-3c94-78f3-c6c5fd465190 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B6AC:3AC7E6:1E54702:2829255:6A51E1E2 |
| html-safe-nonce | e3d7bca7e36b5b8911c5ba6a311be87633067ad83624c5dfef00abfcc9643261 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNkFDOjNBQzdFNjoxRTU0NzAyOjI4MjkyNTU6NkE1MUUxRTIiLCJ2aXNpdG9yX2lkIjoiNjAzOTM1MDA5NzM0MjQ4OTA1OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e84e20a3ab9a84be7f472c1a736e8b75e7d92d00b02879a8771ebc1770570834 |
| hovercard-subject-tag | issue:2956824904 |
| 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/29825/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3bd8750f1c7c19a0236e83c84c93c96e33dfa30e664a9416d195176569e40df1/matplotlib/matplotlib/issues/29825 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3bd8750f1c7c19a0236e83c84c93c96e33dfa30e664a9416d195176569e40df1/matplotlib/matplotlib/issues/29825 |
| og:image:alt | If we are going to go through and re-generate a lot of test images it should be coupled with an audit of if that image actually needs text in it and switching them to the new defaults. Originally p... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jklymak |
| 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