Title: [MNT]: 3D z axis margin is handled differently than x and z · Issue #31213 · matplotlib/matplotlib · GitHub
Open Graph Title: [MNT]: 3D z axis margin is handled differently than x and z · Issue #31213 · matplotlib/matplotlib
X Title: [MNT]: 3D z axis margin is handled differently than x and z · Issue #31213 · matplotlib/matplotlib
Description: Summary The z-axis default margin is 0 for perspective projection, while x/y use 0.05. zz_dataLim and _zmargin are calibrated to produce the same empty-plot limits as x/y, but they diverge when data is present - x and y get margin but z ...
Open Graph Description: Summary The z-axis default margin is 0 for perspective projection, while x/y use 0.05. zz_dataLim and _zmargin are calibrated to produce the same empty-plot limits as x/y, but they diverge when dat...
X Description: Summary The z-axis default margin is 0 for perspective projection, while x/y use 0.05. zz_dataLim and _zmargin are calibrated to produce the same empty-plot limits as x/y, but they diverge when dat...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/31213
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[MNT]: 3D z axis margin is handled differently than x and z","articleBody":"### Summary\n\nThe z-axis default margin is 0 for perspective projection, while x/y use 0.05. `zz_dataLim` and `_zmargin` are calibrated to produce the same empty-plot limits as x/y, but they diverge when data is present - x and y get margin but z does not. `scatter` has a special code path to bump `_zmargin` to 0.05, but this is missing from the other plotting methods. We should have everything on a common code path here with margins for all axes, but this will require regenerating a large number of baseline images.\n\nWaiting on https://github.com/matplotlib/matplotlib/pull/30980, to ensure consistency across different scales. That PR also adds a test for equal blank-plot axis limits.\n\n### Proposed fix\n\n_No response_","author":{"url":"https://github.com/scottshambaugh","@type":"Person","name":"scottshambaugh"},"datePublished":"2026-02-27T23:20:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/31213/matplotlib/issues/31213"}
| 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:adfd454f-8fd3-25a7-c544-1b8d3e0e63fa |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9336:E7D9B:1A504C3:22D4009:6A51D429 |
| html-safe-nonce | c8ec04e13351d391531d7613b011cb3e1bcaad7aa96226af5dc26d72a8d73a81 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MzM2OkU3RDlCOjFBNTA0QzM6MjJENDAwOTo2QTUxRDQyOSIsInZpc2l0b3JfaWQiOiI0NTQwNjY0ODI3NTUxNTM2MTY5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 7d466357663c78659f4c968ea6dced0e6b69febdbd92eb0afa25aa74e65e04db |
| hovercard-subject-tag | issue:4003268507 |
| 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/31213/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9d88382fa002a23295843950fa4fedc21f4ef8426aaeba0d3ec2fa5cfe2935b8/matplotlib/matplotlib/issues/31213 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9d88382fa002a23295843950fa4fedc21f4ef8426aaeba0d3ec2fa5cfe2935b8/matplotlib/matplotlib/issues/31213 |
| og:image:alt | Summary The z-axis default margin is 0 for perspective projection, while x/y use 0.05. zz_dataLim and _zmargin are calibrated to produce the same empty-plot limits as x/y, but they diverge when dat... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | scottshambaugh |
| 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