Title: [Bug]: Errorbar plot on log-scaled Axes sets incorrect automatic lower limits · Issue #31462 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: Errorbar plot on log-scaled Axes sets incorrect automatic lower limits · Issue #31462 · matplotlib/matplotlib
X Title: [Bug]: Errorbar plot on log-scaled Axes sets incorrect automatic lower limits · Issue #31462 · matplotlib/matplotlib
Description: Bug summary I'm plotting some log-scale data with ax.errorbar. If I plot first and then call ax.set_[x/y]scale, autolimits work as expected. However, switching the order (first setting the scale, then plotting the errorbars) leads to inc...
Open Graph Description: Bug summary I'm plotting some log-scale data with ax.errorbar. If I plot first and then call ax.set_[x/y]scale, autolimits work as expected. However, switching the order (first setting the scale, t...
X Description: Bug summary I'm plotting some log-scale data with ax.errorbar. If I plot first and then call ax.set_[x/y]scale, autolimits work as expected. However, switching the order (first setting the scal...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/31462
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Errorbar plot on log-scaled Axes sets incorrect automatic lower limits","articleBody":"### Bug summary\n\nI'm plotting some log-scale data with `ax.errorbar`. If I plot first and then call `ax.set_[x/y]scale`, autolimits work as expected. However, switching the order (first setting the scale, then plotting the errorbars) leads to incorrect autolimits.\n\n### Code for reproduction\n\n```Python\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\nx = 10 ** np.array([18, 18.1, 18.2, 18.3])\ny = np.array([100, 80, 60, 30])\nyerr = np.ones_like(y) * 10\n\nfig, ax = plt.subplots()\nax.set_xscale(\"log\")\nax.set_yscale(\"log\")\nax.errorbar(x, y, yerr=yerr)\n\nfig.savefig(\"test.png\")\n```\n\n### Actual outcome\n\nBoth x and y axes have lower limits at 1. Upper limits seem correct.\n\n\u003cimg width=\"640\" height=\"480\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/5571da22-bc48-465b-bdd1-68e01fe2ddc3\" /\u003e\n\n\n### Expected outcome\n\nIf I call `set_*scale` after plotting, everything works as expected:\n\n\u003cimg width=\"640\" height=\"480\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/7e19e3b9-d012-4290-976c-d5eda8319232\" /\u003e\n\nThe same plot should be produced by the MRE script above.\n\n### Additional information\n\n_No response_\n\n### Operating system\n\nUbuntu\n\n### Matplotlib Version\n\n3.10.8, also occurred on 3.10.5\n\n### Matplotlib Backend\n\nagg\n\n### Python version\n\n3.13.7\n\n### Jupyter version\n\n_No response_\n\n### Installation\n\npip","author":{"url":"https://github.com/nj-vs-vh","@type":"Person","name":"nj-vs-vh"},"datePublished":"2026-04-07T10:09:27.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/31462/matplotlib/issues/31462"}
| 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:b9c666e8-fa1a-7e30-6dc6-0df4068b14fa |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DF24:29B71F:A46A66:DC0578:6A529728 |
| html-safe-nonce | 39071b0d6c4334b133a77c9f923f458678047a0526e2ad2213fb21f5ce430658 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjI0OjI5QjcxRjpBNDZBNjY6REMwNTc4OjZBNTI5NzI4IiwidmlzaXRvcl9pZCI6Ijg2NjUyODM5OTY3ODYyNjc5NDQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f37e817fa221ce36237ceb03607468c96153365ae010b8be275c3c57ec01d61a |
| hovercard-subject-tag | issue:4216955322 |
| 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/31462/issue_layout |
| twitter:image | https://opengraph.githubassets.com/25ee9b6b87395bce5a2e51f5be60a638b1676c8dc7d79fda9543536fc6994cf8/matplotlib/matplotlib/issues/31462 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/25ee9b6b87395bce5a2e51f5be60a638b1676c8dc7d79fda9543536fc6994cf8/matplotlib/matplotlib/issues/31462 |
| og:image:alt | Bug summary I'm plotting some log-scale data with ax.errorbar. If I plot first and then call ax.set_[x/y]scale, autolimits work as expected. However, switching the order (first setting the scale, t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nj-vs-vh |
| 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