Title: Y-axis tickformat='+' causes unexpected scientific notation for zero tick · Issue #5152 · plotly/plotly.py · GitHub
Open Graph Title: Y-axis tickformat='+' causes unexpected scientific notation for zero tick · Issue #5152 · plotly/plotly.py
X Title: Y-axis tickformat='+' causes unexpected scientific notation for zero tick · Issue #5152 · plotly/plotly.py
Description: Hi Plotly team, I'm encountering an issue when trying to display the sign for all Y-axis tick labels using the tickformat='+' format. Specifically, when the Y-axis includes a tick near zero, Plotly displays it in scientific notation inst...
Open Graph Description: Hi Plotly team, I'm encountering an issue when trying to display the sign for all Y-axis tick labels using the tickformat='+' format. Specifically, when the Y-axis includes a tick near zero, Plotly...
X Description: Hi Plotly team, I'm encountering an issue when trying to display the sign for all Y-axis tick labels using the tickformat='+' format. Specifically, when the Y-axis includes a tick near ...
Opengraph URL: https://github.com/plotly/plotly.py/issues/5152
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Y-axis tickformat='+' causes unexpected scientific notation for zero tick","articleBody":"Hi Plotly team,\n\nI'm encountering an issue when trying to display the sign for all Y-axis tick labels using the tickformat='+' format. Specifically, when the Y-axis includes a tick near zero, Plotly displays it in scientific notation instead of as +.\n\n### Problem\nSetting tickformat='+' on the Y-axis leads to unexpected tick labels like -8.881784197e-17, which appears instead of a clean +0. This seems to be due to floating-point precision errors, but it's surprising that it breaks the format hint and drops into scientific notation.\n\n### Minimal reproducible example\n```python\nimport plotly.graph_objects as go\n\nfigure = go.Figure()\n\nfigure.add_scatter(\n x=[1],\n y=[0.58],\n)\n\nfigure.update_layout(\n yaxis={\n 'range': [-0.66, 0.66],\n 'tickformat': '+',\n },\n)\n\nfigure.show()\n```\n\n\u003cimg width=\"1056\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/bf3f1a95-f2f2-4291-bfea-c2c49c772272\" />\n\n### Expected Behavior\nAll tick labels on the Y-axis should respect the + format and include a sign, including zero. The tick at (or near) zero should be displayed as +0, not in scientific notation.\n\nThanks for the awesome work on Plotly!","author":{"url":"https://github.com/eneginsky","@type":"Person","name":"eneginsky"},"datePublished":"2025-04-24T16:16:14Z","url":"https://github.com/plotly/plotly.py/issues/5152"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:d94f5968-dc6d-0262-90e1-70eb5ce720dd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B9CC:30CC09:6091BE:81E153:6AFF8836 |
| html-safe-nonce | eae468237c96d4ccd890db938db527cecafbb7d75c24bd4f2ea9fd5db8c48578 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOUNDOjMwQ0MwOTo2MDkxQkU6ODFFMTUzOjZBRkY4ODM2IiwidmlzaXRvcl9pZCI6IjM0MjA2NDg0NzYxNjAwMDIxMDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b8d6d85563074870e8d4065b85081fad3076ea9aa543094d407429b35893abf4 |
| hovercard-subject-tag | issue:3017783685 |
| 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/plotly/plotly.py/5152/issue_layout |
| twitter:image | https://opengraph.githubassets.com/43b870983190d50bdd072357a4188144e44c0ca12901e75865716804129e24ad/plotly/plotly.py/issues/5152 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/43b870983190d50bdd072357a4188144e44c0ca12901e75865716804129e24ad/plotly/plotly.py/issues/5152 |
| og:image:alt | Hi Plotly team, I'm encountering an issue when trying to display the sign for all Y-axis tick labels using the tickformat='+' format. Specifically, when the Y-axis includes a tick near zero, Plotly... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | eneginsky |
| hostname | github.com |
| expected-hostname | github.com |
| None | 587ad99a3e443b2e1cb0d3df059ec49ab54389861f13310766dfdeb615fed90d |
| turbo-cache-control | no-preview |
| go-import | github.com/plotly/plotly.py git https://github.com/plotly/plotly.py.git |
| octolytics-dimension-user_id | 5997976 |
| octolytics-dimension-user_login | plotly |
| octolytics-dimension-repository_id | 14579099 |
| octolytics-dimension-repository_nwo | plotly/plotly.py |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 14579099 |
| octolytics-dimension-repository_network_root_nwo | plotly/plotly.py |
| 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 | 5bb0fb68d64881d1344f5863d809515d496801e5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width