Title: [Bug]: Setting norm by string doesn't work for hexbin · Issue #28105 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: Setting norm by string doesn't work for hexbin · Issue #28105 · matplotlib/matplotlib
X Title: [Bug]: Setting norm by string doesn't work for hexbin · Issue #28105 · matplotlib/matplotlib
Description: Bug summary In #20752 I added support for imshow(..., norm="log"), and documented that the feature is supported in particular by hexbin as well; but this doesn't actually work for hexbin, because hexbin tries to run stuff on the norm bef...
Open Graph Description: Bug summary In #20752 I added support for imshow(..., norm="log"), and documented that the feature is supported in particular by hexbin as well; but this doesn't actually work for hexbin, because h...
X Description: Bug summary In #20752 I added support for imshow(..., norm="log"), and documented that the feature is supported in particular by hexbin as well; but this doesn't actually work for hex...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/28105
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Setting norm by string doesn't work for hexbin","articleBody":"### Bug summary\n\nIn #20752 I added support for `imshow(..., norm=\"log\")`, and documented that the feature is supported in particular by hexbin as well; but this doesn't actually work for hexbin, because hexbin tries to run stuff on the norm before normalizing strings.\n\n### Code for reproduction\n\n```Python\nfrom pylab import *\r\nhexbin(rand(100), rand(100), norm=\"log\")\n```\n\n\n### Actual outcome\n\n```\r\n File \".../matplotlib/axes/_axes.py\", line 5247, in hexbin\r\n if norm.vmin is None and norm.vmax is None:\r\n ^^^^^^^^^\r\nAttributeError: 'str' object has no attribute 'vmin'\r\n```\n\n### Expected outcome\n\nno error\n\n### Additional information\n\nProbably the block\r\n```python\r\n # autoscale the norm with current accum values if it hasn't been set\r\n if norm is not None:\r\n if norm.vmin is None and norm.vmax is None:\r\n norm.autoscale(accum)\r\n```\r\ncan just be moved down a bit after collection.set_norm(norm) (then we can get back the canonicalized norm from the collection). I haven't looked at how this interacts with the call to _scale_norm just below, though.\n\n### Operating system\n\nany\n\n### Matplotlib Version\n\n3.9.0.dev1523+g2723052176\n\n### Matplotlib Backend\n\nany\n\n### Python version\n\n3.12\n\n### Jupyter version\n\nno\n\n### Installation\n\nNone","author":{"url":"https://github.com/anntzer","@type":"Person","name":"anntzer"},"datePublished":"2024-04-19T14:10:07.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/28105/matplotlib/issues/28105"}
| 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:06fa19de-3682-acf5-68e9-12d44f2bb1b8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 80E0:9C6CC:24756B6:33D6E67:6A50F802 |
| html-safe-nonce | 1b27d05b6b51d76478a0285fbd3a96440cbeead173db7dfd5a9d91a309ca1ec2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MEUwOjlDNkNDOjI0NzU2QjY6MzNENkU2Nzo2QTUwRjgwMiIsInZpc2l0b3JfaWQiOiIxNDQ5MTIxNzc0MTgwNTYyOTQ2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 66dda57e06fa04ad482f8401a82937fb595da3fedaf29deee8d40a406e847df5 |
| hovercard-subject-tag | issue:2253121262 |
| 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/28105/issue_layout |
| twitter:image | https://opengraph.githubassets.com/be35d0a5920133ad346c846f173600e0834959e196b62d9b4371cb8c101d64ee/matplotlib/matplotlib/issues/28105 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/be35d0a5920133ad346c846f173600e0834959e196b62d9b4371cb8c101d64ee/matplotlib/matplotlib/issues/28105 |
| og:image:alt | Bug summary In #20752 I added support for imshow(..., norm="log"), and documented that the feature is supported in particular by hexbin as well; but this doesn't actually work for hexbin, because h... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | anntzer |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5266e58c17a510c403505cc811606465e90a881d2007ee7df1c4800d5c659838 |
| 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 | 8d836581d020676cc0ef4a83cd2fe17e4af02c3d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width