Title: [Bug]: LogFormatter(minor_thresholds=...) should count actually drawn ticks, not number of decades spanned by axes · Issue #29050 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: LogFormatter(minor_thresholds=...) should count actually drawn ticks, not number of decades spanned by axes · Issue #29050 · matplotlib/matplotlib
X Title: [Bug]: LogFormatter(minor_thresholds=...) should count actually drawn ticks, not number of decades spanned by axes · Issue #29050 · matplotlib/matplotlib
Description: Bug summary The first minor_threshold (called subset, defaulting to 1) in LogFormatter is documented as "If numdec > subset then no minor ticks will be labeled" (where numdec) is the number of decades spanned by the axes. Unfortunately, ...
Open Graph Description: Bug summary The first minor_threshold (called subset, defaulting to 1) in LogFormatter is documented as "If numdec > subset then no minor ticks will be labeled" (where numdec) is the number of deca...
X Description: Bug summary The first minor_threshold (called subset, defaulting to 1) in LogFormatter is documented as "If numdec > subset then no minor ticks will be labeled" (where numdec) is the n...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/29050
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: LogFormatter(minor_thresholds=...) should count actually drawn ticks, not number of decades spanned by axes","articleBody":"### Bug summary\n\nThe first minor_threshold (called `subset`, defaulting to 1) in LogFormatter is documented as \"If ``numdec \u003e subset`` then no minor ticks will be labeled\" (where `numdec`) is the number of decades spanned by the axes. Unfortunately, even if an axes spans more than one decade, there may be a single major tick in it, in which case I think we still want to show some minor ticks.\n\n### Code for reproduction\n\n```Python\nsubplot(121).set(yscale=\"log\", ylim=(.55, 4.5))\r\nsubplot(122).set(yscale=\"log\", ylim=(.45, 5.5))\n```\n\n\n### Actual outcome\n\n\r\n\n\n### Expected outcome\n\nThe second axes (spanning from 0.45 to 5.5, i.e. slightly more than one decade, but with only one major tick) should also have minor ticks drawn.\n\n### Additional information\n\nThis can probably(?) be fixed by reinterpreting `subset` as \"if there is no more than `subset` major ticks drawn, then label the minor ticks\". (The minor tick formatter doesn't actually know about the major tickers, so the logic is more something like `int(log(vmax)/log(b)) - int(log(vmin)/log(b)) \u003c= threshold`, up to off-by-1 errors...)\r\n\r\n(@efiring wrote the original logic, I think, per https://github.com/matplotlib/matplotlib/pull/7438#issuecomment-260753221.)\n\n### Operating system\n\nmacos\n\n### Matplotlib Version\n\n3.9\n\n### Matplotlib Backend\n\nany\n\n### Python version\n\n3.12\n\n### Jupyter version\n\nno\n\n### Installation\n\ngit checkout","author":{"url":"https://github.com/anntzer","@type":"Person","name":"anntzer"},"datePublished":"2024-10-31T10:58:43.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/29050/matplotlib/issues/29050"}
| 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:fd4bd561-715e-41d5-923e-be495238299c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A938:12317A:8EFD20:C4DCF5:6A5200D4 |
| html-safe-nonce | 61a783bab65a6b2dab4e817a3397af62d740b624f5c0e5efdc041e93bd086f45 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOTM4OjEyMzE3QTo4RUZEMjA6QzREQ0Y1OjZBNTIwMEQ0IiwidmlzaXRvcl9pZCI6IjkxMjY4MzkzMTE0NzEzNDU4NzYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3e7666843e22158dd73cafe12274dd4ae3e0a6e05c6e54f233ae43d4788fa845 |
| hovercard-subject-tag | issue:2626569539 |
| 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/29050/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fb98c7fdd9d3919ff32546005c234b554f23dabf2d2dfaa05a29984c3b8b65e9/matplotlib/matplotlib/issues/29050 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fb98c7fdd9d3919ff32546005c234b554f23dabf2d2dfaa05a29984c3b8b65e9/matplotlib/matplotlib/issues/29050 |
| og:image:alt | Bug summary The first minor_threshold (called subset, defaulting to 1) in LogFormatter is documented as "If numdec > subset then no minor ticks will be labeled" (where numdec) is the number of deca... |
| 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 | 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width