Title: Issue with minor tick spacing in colorbar with custom Normalize class · Issue #12808 · matplotlib/matplotlib · GitHub
Open Graph Title: Issue with minor tick spacing in colorbar with custom Normalize class · Issue #12808 · matplotlib/matplotlib
X Title: Issue with minor tick spacing in colorbar with custom Normalize class · Issue #12808 · matplotlib/matplotlib
Description: Bug report Bug summary Minor ticks don't appear in the right place in colorbars when a custom Normalize class is used. Code for reproduction The following example requires astropy. If needed I can try and provide an example that doesn't ...
Open Graph Description: Bug report Bug summary Minor ticks don't appear in the right place in colorbars when a custom Normalize class is used. Code for reproduction The following example requires astropy. If needed I can ...
X Description: Bug report Bug summary Minor ticks don't appear in the right place in colorbars when a custom Normalize class is used. Code for reproduction The following example requires astropy. If needed I ...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/12808
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Issue with minor tick spacing in colorbar with custom Normalize class","articleBody":"### Bug report\r\n\r\n**Bug summary**\r\n\r\nMinor ticks don't appear in the right place in colorbars when a custom Normalize class is used.\r\n\r\n**Code for reproduction**\r\n\r\nThe following example requires [astropy](http://www.astropy.org). If needed I can try and provide an example that doesn't use this.\r\n\r\n```python\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nfrom astropy.visualization import LogStretch, ImageNormalize, PercentileInterval\r\n\r\ndata = np.arange(256).reshape((16, 16))\r\n\r\nnorm = ImageNormalize(data, interval=PercentileInterval(99), stretch=LogStretch())\r\n\r\nplt.rcParams['xtick.minor.visible'] = True\r\n\r\nfig = plt.figure()\r\nax = fig.add_subplot(1, 1, 1)\r\nim = ax.imshow(data, norm=norm)\r\ncb = fig.colorbar(im)\r\nfig.savefig('test.png')\r\n```\r\n\r\n**Actual outcome**\r\n\r\n\r\n\r\n**Expected outcome**\r\n\r\nThe minor ticks should respect the spacing of the current stretch.\r\n\r\nI noticed that using LogNorm, the ticks used to be spaced incorrectly in Matplotlib 2.2 but this was fixed in Matplotlib 3.0. However, the minor ticks are still broken for custom normalizations as shown above.\r\n\r\n**Matplotlib version**\r\n\r\n * Operating system: MacOS X 10.13.6\r\n * Matplotlib version: 3.0.1\r\n * Matplotlib backend: Agg\r\n * Python version: 3.7.1\r\n","author":{"url":"https://github.com/astrofrog","@type":"Person","name":"astrofrog"},"datePublished":"2018-11-14T16:37:19.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/12808/matplotlib/issues/12808"}
| 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:6248bb21-6be1-f626-2f56-b2ea6b00d42b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E5B4:225DDE:95A2AC:C9C196:6A530E58 |
| html-safe-nonce | 8a1d47cfb89a0ed30d96bcf808f69d464a8424ce353defa362fdc97ea561cb27 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNUI0OjIyNURERTo5NUEyQUM6QzlDMTk2OjZBNTMwRTU4IiwidmlzaXRvcl9pZCI6IjUyMDYyMTQ4NzEwMDAyMjMzMjAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | fd0168a8c6d73a37d507f2fcf0b3e192b561a23d683f593cb4cc0daa0ba3df13 |
| hovercard-subject-tag | issue:380784680 |
| 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/12808/issue_layout |
| twitter:image | https://opengraph.githubassets.com/89d19bc8f39c8a7469b99ce779f85f3cdb20f3883aa15af0f4d45519e93c0748/matplotlib/matplotlib/issues/12808 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/89d19bc8f39c8a7469b99ce779f85f3cdb20f3883aa15af0f4d45519e93c0748/matplotlib/matplotlib/issues/12808 |
| og:image:alt | Bug report Bug summary Minor ticks don't appear in the right place in colorbars when a custom Normalize class is used. Code for reproduction The following example requires astropy. If needed I can ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | astrofrog |
| 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 | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width