Title: [MNT]: Consider consolidating the Formatter API · Issue #31396 · matplotlib/matplotlib · GitHub
Open Graph Title: [MNT]: Consider consolidating the Formatter API · Issue #31396 · matplotlib/matplotlib
X Title: [MNT]: Consider consolidating the Formatter API · Issue #31396 · matplotlib/matplotlib
Description: Summary Inspired by #31392 (review) Should we constrain the public API? In particular, I don't think set_locs is needed publically. Calling format_ticks(values) should be sufficent and it should be possible to make the locs state an impl...
Open Graph Description: Summary Inspired by #31392 (review) Should we constrain the public API? In particular, I don't think set_locs is needed publically. Calling format_ticks(values) should be sufficent and it should be...
X Description: Summary Inspired by #31392 (review) Should we constrain the public API? In particular, I don't think set_locs is needed publically. Calling format_ticks(values) should be sufficent and it shoul...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/31396
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[MNT]: Consider consolidating the Formatter API","articleBody":"### Summary\n\nInspired by https://github.com/matplotlib/matplotlib/pull/31392#pullrequestreview-4013806029\n\n\u003e Should we constrain the public API?\n\u003e\n\u003e In particular, I don't think `set_locs` is needed publically. Calling `format_ticks(values)` should be sufficent and it should be possible to make the `locs` state an implementation detail.\n\u003e\n\u003e Additionally, one could check / clarify the relation of `__call__` and `format_data`. Are both needed publically?\n\nAlso #5804 may be considered.\n\n### Proposed fix\n\nThis is a tracking item for the idea. It's not yet ready to be worked on, because we first need a deeper analysis on the current usage and a discussion on the desired API.\n\nPossible improvements:\n\n- Distinguish between configuration (e.g. base for LogFormatter) and context. Context is information extracted from a set of tick values that may influence how single ticks are rendered (e.g. precision or offset). The context is currently partly public. As a first step, we can make the context private (#31416). This will open up possibilities for re-architecting internal logic: Currently context is stored as persistent state on the Formatter, but we may be able to remove this state (will also require making `set_locs()` private.\n- ...\n","author":{"url":"https://github.com/timhoffm","@type":"Person","name":"timhoffm"},"datePublished":"2026-03-26T17:11:46.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/31396/matplotlib/issues/31396"}
| 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:1ed81bbc-f949-7f77-7645-32e49c839b41 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 99D0:A8D95:FB80B3:1501683:6A51C0DD |
| html-safe-nonce | 446cc6cc2378a2d54bc8fb8782adef599ffaee9ede94c49779925f620eb42951 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OUQwOkE4RDk1OkZCODBCMzoxNTAxNjgzOjZBNTFDMEREIiwidmlzaXRvcl9pZCI6IjMyOTI5NTY5NjgxMzQ3NTQ1MjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 83848b4db3f49df78b9503af9f33bfd892c071b8a694e43ee1e614888c54760e |
| hovercard-subject-tag | issue:4145826269 |
| 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/31396/issue_layout |
| twitter:image | https://opengraph.githubassets.com/225fbaf9c5b1ae90e9f8b35f63f55746f2d215d6974157549af5e3d8122c16dd/matplotlib/matplotlib/issues/31396 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/225fbaf9c5b1ae90e9f8b35f63f55746f2d215d6974157549af5e3d8122c16dd/matplotlib/matplotlib/issues/31396 |
| og:image:alt | Summary Inspired by #31392 (review) Should we constrain the public API? In particular, I don't think set_locs is needed publically. Calling format_ticks(values) should be sufficent and it should be... |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width