Title: [MNT]: API consistency for Figure layout_engine · Issue #29636 · matplotlib/matplotlib · GitHub
Open Graph Title: [MNT]: API consistency for Figure layout_engine · Issue #29636 · matplotlib/matplotlib
X Title: [MNT]: API consistency for Figure layout_engine · Issue #29636 · matplotlib/matplotlib
Description: Summary Summary Split out of #24617. Before we can implement this, we need a though API discussion (#24617 (comment)). Current state: We have figure(..., layout=...) But set/get_layout_engine(). I'm opposed to creating an alias set_layou...
Open Graph Description: Summary Summary Split out of #24617. Before we can implement this, we need a though API discussion (#24617 (comment)). Current state: We have figure(..., layout=...) But set/get_layout_engine(). I'...
X Description: Summary Summary Split out of #24617. Before we can implement this, we need a though API discussion (#24617 (comment)). Current state: We have figure(..., layout=...) But set/get_layout_engine(). I&...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/29636
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[MNT]: API consistency for Figure layout_engine","articleBody":"### Summary\n\n### Summary\n\nSplit out of #24617. Before we can implement this, we need a though API discussion (https://github.com/matplotlib/matplotlib/issues/24617#issuecomment-2662713614).\n\nCurrent state:\n- We have `figure(..., layout=...)`\n- But `set/get_layout_engine()`.\n\nI'm opposed to creating an alias `set_layout`/`set_layout_engine`.\n\nWe should converge to one name. While `layout_engine` is more explicit `layout` seems good enough. If the name would only be used rarely I'd go with the longer option, but since we don't have a layout engine by default, people must often use `plt.subplots(..., layout=\"constrained\")` and `plt.subplots(..., layout_engine=\"constrained\")` is way too long to just create a figure.\n\nSemi-OT: I'm tempted to start a discussion whether we can make constrained layout the default. It is what people would want most of the time, and having to always explicitly enable it is a nuissance. Of course it's a significant change and imacts basically all figures created with matplotlib. OTOH it's \"only\" a shift of some of the graphic elements, which does not affect the visual expression of the figure - I claim most people would not notice. And if you want the previous behavior, you can set the layout engine to none.\n\nEither way, if we want to move forward on the layout topic, we should agree on one name and slowly phase out the other. At least discourage, but possibly pending deprecate.\n\n\n### Proposed fix\n\n_No response_","author":{"url":"https://github.com/timhoffm","@type":"Person","name":"timhoffm"},"datePublished":"2025-02-17T11:02:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/29636/matplotlib/issues/29636"}
| 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:3fb46ca2-5c2a-c669-c87f-68de75c17b20 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C3AE:323BC4:62D813:827403:6A530774 |
| html-safe-nonce | 510e26dafd4d3fdaeae0190f9955168dc1c5ee3879b0973e0d70d19f6b5f0bcb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDM0FFOjMyM0JDNDo2MkQ4MTM6ODI3NDAzOjZBNTMwNzc0IiwidmlzaXRvcl9pZCI6IjYzMzM3Njg3OTEyMjMzNzE2MzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5b1602f559325c481129464a3cf48bb86384445f3cb4276407fb30298bbcffe5 |
| hovercard-subject-tag | issue:2857509092 |
| 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/29636/issue_layout |
| twitter:image | https://opengraph.githubassets.com/af9d4828c0285600cf7af6c56e213d3f90b77ae69b018f4b57d82e413cd6085b/matplotlib/matplotlib/issues/29636 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/af9d4828c0285600cf7af6c56e213d3f90b77ae69b018f4b57d82e413cd6085b/matplotlib/matplotlib/issues/29636 |
| og:image:alt | Summary Summary Split out of #24617. Before we can implement this, we need a though API discussion (#24617 (comment)). Current state: We have figure(..., layout=...) But set/get_layout_engine(). I'... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | timhoffm |
| 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 | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width