Title: [Bug]: `get_ticklocs()` returns ticks outside axis limits for log scale · Issue #24572 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: `get_ticklocs()` returns ticks outside axis limits for log scale · Issue #24572 · matplotlib/matplotlib
X Title: [Bug]: `get_ticklocs()` returns ticks outside axis limits for log scale · Issue #24572 · matplotlib/matplotlib
Description: Bug summary get_ticklocs() is returning ticks outside the axis limits, when the scale is set to log. I discovered this when writing some tests for LogLocator in #24436. Code for reproduction import matplotlib.pyplot as plt fig, ax = plt....
Open Graph Description: Bug summary get_ticklocs() is returning ticks outside the axis limits, when the scale is set to log. I discovered this when writing some tests for LogLocator in #24436. Code for reproduction import...
X Description: Bug summary get_ticklocs() is returning ticks outside the axis limits, when the scale is set to log. I discovered this when writing some tests for LogLocator in #24436. Code for reproduction import...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/24572
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: `get_ticklocs()` returns ticks outside axis limits for log scale","articleBody":"### Bug summary\n\n`get_ticklocs()` is returning ticks outside the axis limits, when the scale is set to log.\r\n\r\nI discovered this when writing some tests for `LogLocator` in https://github.com/matplotlib/matplotlib/pull/24436.\n\n### Code for reproduction\n\n```python\nimport matplotlib.pyplot as plt\r\n\r\nfig, ax = plt.subplots()\r\n\r\nax.set_xscale('log')\r\nax.set_xlim(1, 99)\r\n\r\nfig.canvas.draw()\r\nprint(ax.xaxis.get_ticklocs())\r\n# [1.e-01 1.e+00 1.e+01 1.e+02 1.e+03]\r\nplt.show()\n```\n\n\n### Actual outcome\n\nPrints `[1.e-01 1.e+00 1.e+01 1.e+02 1.e+03]`, but plots this:\r\n\r\n\r\n\r\nNote that the only ticks shown on this graph are 1 and 10.\n\n### Expected outcome\n\n`ax.xaxis.get_ticklocs()` returns only tick locations present on the axis.\n\n### Additional information\n\n_No response_\n\n### Operating system\n\n_No response_\n\n### Matplotlib Version\n\n3.7.0.dev656+g79807c34ad.d20221130\n\n### Matplotlib Backend\n\n_No response_\n\n### Python version\n\n_No response_\n\n### Jupyter version\n\n_No response_\n\n### Installation\n\n_No response_","author":{"url":"https://github.com/dstansby","@type":"Person","name":"dstansby"},"datePublished":"2022-11-30T22:42:00.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/24572/matplotlib/issues/24572"}
| 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:10faa100-6224-97fe-8add-4785a58f1588 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BB88:1CCBDE:F78FCA:14ED464:6A5331BB |
| html-safe-nonce | 3f8de2c924ffd138fa280daff1555a993255289449c07a0448412f5a23b996ca |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQjg4OjFDQ0JERTpGNzhGQ0E6MTRFRDQ2NDo2QTUzMzFCQiIsInZpc2l0b3JfaWQiOiI0MzgxNjgzNTg1MTM4MjQxOTc5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 10b6cf7278b95475eda1f81a1cd3f08ba70ba44428cfacdbd2c42bb4eb65cb01 |
| hovercard-subject-tag | issue:1470314547 |
| 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/24572/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8e2a9850222753c226664e42b5287d92b520896c01807cc548e0d13a0fe6000b/matplotlib/matplotlib/issues/24572 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8e2a9850222753c226664e42b5287d92b520896c01807cc548e0d13a0fe6000b/matplotlib/matplotlib/issues/24572 |
| og:image:alt | Bug summary get_ticklocs() is returning ticks outside the axis limits, when the scale is set to log. I discovered this when writing some tests for LogLocator in #24436. Code for reproduction import... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dstansby |
| 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 | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width