Title: Blank colorbars for high dynamic range LogNorm imshow plots · Issue #10051 · matplotlib/matplotlib · GitHub
Open Graph Title: Blank colorbars for high dynamic range LogNorm imshow plots · Issue #10051 · matplotlib/matplotlib
X Title: Blank colorbars for high dynamic range LogNorm imshow plots · Issue #10051 · matplotlib/matplotlib
Description: Bug summary When creating a LogNorm imshow plot with more than 9 orders of magnitude of dynamic range the automatically generated colorbar from plt.colorbar() has no automatically generated tick marks or labels. Code for reproduction Thi...
Open Graph Description: Bug summary When creating a LogNorm imshow plot with more than 9 orders of magnitude of dynamic range the automatically generated colorbar from plt.colorbar() has no automatically generated tick ma...
X Description: Bug summary When creating a LogNorm imshow plot with more than 9 orders of magnitude of dynamic range the automatically generated colorbar from plt.colorbar() has no automatically generated tick ma...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/10051
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Blank colorbars for high dynamic range LogNorm imshow plots","articleBody":"**Bug summary**\r\n\r\nWhen creating a LogNorm imshow plot with more than 9 orders of magnitude of dynamic range the automatically generated colorbar from plt.colorbar() has no automatically generated tick marks or labels.\r\n\r\n**Code for reproduction**\r\n\r\n\u003c!--A minimum code snippet required to reproduce the bug, also minimizing the number of dependencies required--\u003e\r\n\r\nThis generates a plot with colorbar tick labels\r\n\r\n```python\r\nimport numpy as np\r\n\r\nfrom matplotlib import pyplot as plt\r\nfrom matplotlib.colors import LogNorm\r\n\r\ndata = np.zeros((800, 800)) + 1\r\ndata[50, 51] = 1e9\r\n\r\nprint(np.log10(data.max()/data.min()))\r\n\r\nimage = plt.imshow(data, origin='lower', interpolation='nearest', norm=LogNorm())\r\nplt.colorbar(image)\r\n\r\nplt.savefig('labels.png')\r\n```\r\n\r\n\r\n\r\nWhile this script generates a plot with no colorbar tick labels:\r\n\r\n```python\r\nimport numpy as np\r\n\r\nfrom matplotlib import pyplot as plt\r\nfrom matplotlib.colors import LogNorm\r\n\r\ndata = np.zeros((800, 800)) + 1\r\ndata[50, 51] = 2e9\r\n\r\nprint(np.log10(data.max()/data.min()))\r\n\r\nimage = plt.imshow(data, origin='lower', interpolation='nearest', norm=LogNorm())\r\nplt.colorbar(image)\r\n\r\nplt.savefig('no-labels.png')\r\n```\r\n\r\n\r\n\r\n\r\n**Expected outcome**\r\n\r\nI would expect the second plot to also have colorbar tick labels.\r\n\r\n**Matplotlib version**\r\n\u003c!--Please specify your platform and versions of the relevant libraries you are using:--\u003e\r\n * Operating system: Mac OS High Sierra\r\n * Matplotlib version: 2.1.1 (installed via pip)\r\n * Matplotlib backend (`print(matplotlib.get_backend())`): MacOSX\r\n * Python version: 3.6\r\n\r\n\u003c!--Please tell us how you installed matplotlib and python e.g., from source, pip, conda--\u003e\r\n\u003c!--If you installed from conda, please specify which channel you used if not the default--\u003e\r\n\r\n","author":{"url":"https://github.com/ngoldbaum","@type":"Person","name":"ngoldbaum"},"datePublished":"2017-12-20T01:32:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":17},"url":"https://github.com/10051/matplotlib/issues/10051"}
| 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:32322618-377f-0ed7-0c0c-a7bace69ae14 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A5E0:3C7497:4402E8:5CAEC3:6A5801B4 |
| html-safe-nonce | c9ca79e01f1b55f2e1c619115bde8b84908178c01233be784a778b30a41531dc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNUUwOjNDNzQ5Nzo0NDAyRTg6NUNBRUMzOjZBNTgwMUI0IiwidmlzaXRvcl9pZCI6IjQ4Mjc0NDQ4MzYxOTc0NjY1NDgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | afa59783d8a53b547be73b18bd69f59ef77fe824d1d9d4a04cee077efc7b7b79 |
| hovercard-subject-tag | issue:283422136 |
| 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/10051/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fabfa53df0ff15fdde9f71bf2ce7a968b78c7bf189af4a9c03dea66155565bb9/matplotlib/matplotlib/issues/10051 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fabfa53df0ff15fdde9f71bf2ce7a968b78c7bf189af4a9c03dea66155565bb9/matplotlib/matplotlib/issues/10051 |
| og:image:alt | Bug summary When creating a LogNorm imshow plot with more than 9 orders of magnitude of dynamic range the automatically generated colorbar from plt.colorbar() has no automatically generated tick ma... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ngoldbaum |
| hostname | github.com |
| expected-hostname | github.com |
| None | 49c8c15fabcbf356d607a90ca115c13b273e42ff8b74155de050fd229a9b0121 |
| 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 | 3fb1f684e7a833eb1b2d01d39875a2b52cb4fe9b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width