Title: Proof of concept images with units by dstansby · Pull Request #19481 · matplotlib/matplotlib · GitHub
Open Graph Title: Proof of concept images with units by dstansby · Pull Request #19481 · matplotlib/matplotlib
X Title: Proof of concept images with units by dstansby · Pull Request #19481 · matplotlib/matplotlib
Description: xref #19476 There is likely lots to iron out, and many tests and documentation that would need adding, but I thought I would open this as a proof of concept for images (or more generally mappables) with units. Things that come to mind are: Unit converters expect an axis argument, I'm not sure what to do about this when we have a mappable and not an axis munits.registry.get_converter expects a 1D sequence as input, not 2D, there's probably a way to modify this though This allows things like this image, where the correct formatter is automatically set on the colorbar: from datetime import datetime, timedelta import matplotlib.colors as mcolor import matplotlib.pyplot as plt data = [[datetime.now(), datetime.now() - timedelta(seconds=1)], [datetime.now(), datetime.now()]] fig, ax = plt.subplots() im = ax.imshow(data) fig.colorbar(im) plt.show()
Open Graph Description: xref #19476 There is likely lots to iron out, and many tests and documentation that would need adding, but I thought I would open this as a proof of concept for images (or more generally mappables)...
X Description: xref #19476 There is likely lots to iron out, and many tests and documentation that would need adding, but I thought I would open this as a proof of concept for images (or more generally mappables)...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/19481
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:39ff0c8e-7f01-2435-6dc5-ec3e489d41e4 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C99A:20E8B8:B5B45A:F90CD3:6A53A16C |
| html-safe-nonce | b3ecee18d3505e997d65b00d4c0c545029ea8d7e916407eb4891577d8d625d92 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTlBOjIwRThCODpCNUI0NUE6RjkwQ0QzOjZBNTNBMTZDIiwidmlzaXRvcl9pZCI6IjQxNTQ3NTU0Mjc1MjYyMjIxODkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 80a37c7c7588da7d60c491f3828ae536609abdbdd4f78d4485ccb78a4707875e |
| hovercard-subject-tag | pull_request:569528163 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/matplotlib/matplotlib/pull/19481/files |
| twitter:image | https://avatars.githubusercontent.com/u/6197628?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/6197628?s=400&v=4 |
| og:image:alt | xref #19476 There is likely lots to iron out, and many tests and documentation that would need adding, but I thought I would open this as a proof of concept for images (or more generally mappables)... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| 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