Title: [MNT]: Not possible to set `AutoDateFormatter` rcParam to function without deprecation warning · Issue #23012 · matplotlib/matplotlib · GitHub
Open Graph Title: [MNT]: Not possible to set `AutoDateFormatter` rcParam to function without deprecation warning · Issue #23012 · matplotlib/matplotlib
X Title: [MNT]: Not possible to set `AutoDateFormatter` rcParam to function without deprecation warning · Issue #23012 · matplotlib/matplotlib
Description: Summary Not clear if it should be possible, but it is possible to use functions instead of format strings so one may think it should be possible to set the rcParam to a function as well. The documentation is a bit vague and do not really...
Open Graph Description: Summary Not clear if it should be possible, but it is possible to use functions instead of format strings so one may think it should be possible to set the rcParam to a function as well. The docume...
X Description: Summary Not clear if it should be possible, but it is possible to use functions instead of format strings so one may think it should be possible to set the rcParam to a function as well. The docume...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/23012
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[MNT]: Not possible to set `AutoDateFormatter` rcParam to function without deprecation warning","articleBody":"### Summary\r\n\r\nNot clear if it should be possible, but it is possible to use functions instead of format strings so one may think it should be possible to set the `rcParam` to a function as well. The documentation is a bit vague and do not really encourage changing them, so maybe it is not supposed to be possible.\r\n\r\nhttps://github.com/matplotlib/matplotlib/blob/65e962008a1f43fca4b1096c6f88685892d1ab2d/lib/matplotlib/dates.py#L867-L869\r\n```\r\nIn [1]: mpl.rcParams['date.autoformatter.year'] = lambda a: str(a)\r\nC:\\Users\\Oscar\\AppData\\Local\\Temp\\ipykernel_9940\\331672118.py:1: MatplotlibDeprecationWarning: Support for setting an rcParam that expects a str value to a non-str value is deprecated since 3.5 and support will be removed two minor releases later.\r\n mpl.rcParams['date.autoformatter.year'] = lambda a: str(a)\r\n```\r\n\r\n### Proposed fix\r\n\r\nAdd a \"string or callable\" verifier and use that.","author":{"url":"https://github.com/oscargus","@type":"Person","name":"oscargus"},"datePublished":"2022-05-08T10:16:11.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/23012/matplotlib/issues/23012"}
| 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:e3f69aa1-6d37-1957-9ae1-f974c815977a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AF74:8E3D:1A9684A:22FC078:6A52CB3C |
| html-safe-nonce | c715452afb57f947372b7f34d228cf8458b9593e9840a26605e389de4d8628d7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRjc0OjhFM0Q6MUE5Njg0QToyMkZDMDc4OjZBNTJDQjNDIiwidmlzaXRvcl9pZCI6IjcyOTYwMTgzNjIzNDUzNzY1NzMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9ba4bce7f85a4ab728b12323dc96e46cfe660a210fe0dac4edaab8577dee3461 |
| hovercard-subject-tag | issue:1228848610 |
| 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/23012/issue_layout |
| twitter:image | https://opengraph.githubassets.com/170fc7e60d6372bb3aa1104ba7b6410262e9e58aa3b1aa572fce5605f09cb750/matplotlib/matplotlib/issues/23012 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/170fc7e60d6372bb3aa1104ba7b6410262e9e58aa3b1aa572fce5605f09cb750/matplotlib/matplotlib/issues/23012 |
| og:image:alt | Summary Not clear if it should be possible, but it is possible to use functions instead of format strings so one may think it should be possible to set the rcParam to a function as well. The docume... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | oscargus |
| 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