Title: fix: handle NoNorm in format_cursor_data to prevent OverflowError by mayank-dev-15 · Pull Request #32011 · matplotlib/matplotlib · GitHub
Open Graph Title: fix: handle NoNorm in format_cursor_data to prevent OverflowError by mayank-dev-15 · Pull Request #32011 · matplotlib/matplotlib
X Title: fix: handle NoNorm in format_cursor_data to prevent OverflowError by mayank-dev-15 · Pull Request #32011 · matplotlib/matplotlib
Description: Bug Fixes #31960 When imshow is used with uint8 data and colors.NoNorm(), mousing over the image causes an OverflowError because NoNorm.call returns the raw uint8 value unchanged, and subsequent arithmetic ( ormed * n) overflows uint8 in NumPy 2.x. Fix In _sig_digits_from_norm, cast ormed to float when NoNorm is used. This prevents the uint8 overflow while preserving correct behavior for all other norms. Reproduction \\python import matplotlib import matplotlib.pyplot as plt import numpy as np img = np.tile(np.arange(100, dtype=np.uint8), (100, 1)) plt.imshow(img, norm=matplotlib.colors.NoNorm()) plt.show() Mouse over the image — OverflowError \\ Test Verified the fix resolves the overflow by confirming ormed * n no longer overflows when normed is cast to float.
Open Graph Description: Bug Fixes #31960 When imshow is used with uint8 data and colors.NoNorm(), mousing over the image causes an OverflowError because NoNorm.call returns the raw uint8 value unchanged, and subsequent ar...
X Description: Bug Fixes #31960 When imshow is used with uint8 data and colors.NoNorm(), mousing over the image causes an OverflowError because NoNorm.call returns the raw uint8 value unchanged, and subsequent ar...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/32011
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:3284b3e4-a839-041e-b7ff-3f18b0c4ccfe |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B3EC:15A51:1172378:1897439:6A50A81A |
| html-safe-nonce | 93407cbf13c688c8b75ae8231b10617a98e16f8b4da95fd3fe4126e34bfb31bb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCM0VDOjE1QTUxOjExNzIzNzg6MTg5NzQzOTo2QTUwQTgxQSIsInZpc2l0b3JfaWQiOiI0NzI3MjAwNDE5NzY3NDI5MTQ2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 3f86f91f9eb8ef9f94bd19323146f4b16674a9abc6b5fad706a68518589a59a2 |
| hovercard-subject-tag | pull_request:4008806641 |
| 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/32011/files |
| twitter:image | https://avatars.githubusercontent.com/u/289773841?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/289773841?s=400&v=4 |
| og:image:alt | Bug Fixes #31960 When imshow is used with uint8 data and colors.NoNorm(), mousing over the image causes an OverflowError because NoNorm.call returns the raw uint8 value unchanged, and subsequent ar... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | d6dc8294eb500fa36bbc57472d61fe87c522f9c3c1d64f70f4926f66a66a7efb |
| 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 |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7ac0ad2f2c7e4b9056617355fd9e33e22b0c8df9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width