Title: [ENH]: use new style format strings for colorbar ticks · Issue #21378 · matplotlib/matplotlib · GitHub
Open Graph Title: [ENH]: use new style format strings for colorbar ticks · Issue #21378 · matplotlib/matplotlib
X Title: [ENH]: use new style format strings for colorbar ticks · Issue #21378 · matplotlib/matplotlib
Description: Problem At the moment, the default format strings in colorbar are old style ones, as in their init there is: matplotlib/lib/matplotlib/colorbar.py Lines 489 to 492 in 67e1814 if isinstance(format, str): self.formatter = ticker.FormatStrF...
Open Graph Description: Problem At the moment, the default format strings in colorbar are old style ones, as in their init there is: matplotlib/lib/matplotlib/colorbar.py Lines 489 to 492 in 67e1814 if isinstance(format, ...
X Description: Problem At the moment, the default format strings in colorbar are old style ones, as in their init there is: matplotlib/lib/matplotlib/colorbar.py Lines 489 to 492 in 67e1814 if isinstance(format, ...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/21378
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[ENH]: use new style format strings for colorbar ticks","articleBody":"### Problem\n\nAt the moment, the default format strings in colorbar are old style ones, as in their init there is:\r\n\r\nhttps://github.com/matplotlib/matplotlib/blob/67e18148d87db04d2c8d4293ff12c56fbbb7fde8/lib/matplotlib/colorbar.py#L489-L492\r\n\r\nwhich is a different convention from the one of a normal axis, which was introduced in #16715. \n\n### Proposed solution\n\nAs in `update_ticks` we pass the colorbar's formatter to the long axis,\r\n\r\nhttps://github.com/matplotlib/matplotlib/blob/67e18148d87db04d2c8d4293ff12c56fbbb7fde8/lib/matplotlib/colorbar.py#L801\r\n\r\nthe `if` statement above may be removed to keep the default logic only in `Axis`. Right now one can pass a callable directly (although that's not documented), and the default behaviour from #16715 is triggered. However, I guess making this change for format strings would imply a deprecation cycle, as it breaks current behaviour. Another option would be to check in `Axis._set_formatter` for what kind of string format we've been passed (unsure how, although there must be way).\n\n### Additional context and prior art\n\n_No response_","author":{"url":"https://github.com/TLouf","@type":"Person","name":"TLouf"},"datePublished":"2021-10-18T14:05:55.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/21378/matplotlib/issues/21378"}
| 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:b2a5e507-741d-9a5a-5ea5-3e7edf9490a8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9236:917F8:871AF9:B2EF31:6A530EFB |
| html-safe-nonce | e9cb24cce6b127d8555854acbd50b283d596c37750ed14dc6b62d9ed58a86d80 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MjM2OjkxN0Y4Ojg3MUFGOTpCMkVGMzE6NkE1MzBFRkIiLCJ2aXNpdG9yX2lkIjoiMjIxNzQ1MTc4OTQ3Njg5MjQxMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a5f4ea8164f4ed9e872fd3a830f39e2f8c3a8dc6664766c882a1af81c8a45366 |
| hovercard-subject-tag | issue:1029167355 |
| 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/21378/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b578b1055f2957c06b7458471ae0a838f763afca6275e5c939a5367fefabab49/matplotlib/matplotlib/issues/21378 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b578b1055f2957c06b7458471ae0a838f763afca6275e5c939a5367fefabab49/matplotlib/matplotlib/issues/21378 |
| og:image:alt | Problem At the moment, the default format strings in colorbar are old style ones, as in their init there is: matplotlib/lib/matplotlib/colorbar.py Lines 489 to 492 in 67e1814 if isinstance(format, ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | TLouf |
| 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