Title: [BUG]: Heatmap with a single x value on a category axis is drawn at 2× its category index · Issue #8175 · plotly/plotly.js · GitHub
Open Graph Title: [BUG]: Heatmap with a single x value on a category axis is drawn at 2× its category index · Issue #8175 · plotly/plotly.js
X Title: [BUG]: Heatmap with a single x value on a category axis is drawn at 2× its category index · Issue #8175 · plotly/plotly.js
Description: Description When a heatmap trace has exactly one x value on a categorical x-axis, its column is drawn at twice the category’s index. This only shows when that category isn’t the first one on the axis. Minimal example Plotly.newPlot('gd',...
Open Graph Description: Description When a heatmap trace has exactly one x value on a categorical x-axis, its column is drawn at twice the category’s index. This only shows when that category isn’t the first one on the ax...
X Description: Description When a heatmap trace has exactly one x value on a categorical x-axis, its column is drawn at twice the category’s index. This only shows when that category isn’t the first one on the ax...
Opengraph URL: https://github.com/plotly/plotly.js/issues/8175
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[BUG]: Heatmap with a single x value on a category axis is drawn at 2× its category index","articleBody":"### Description\n\nWhen a heatmap trace has exactly one x value on a categorical x-axis, its column is drawn at twice the category’s index. This only shows when that category isn’t the first one on the axis.\n\n#### Minimal example\n```js\nPlotly.newPlot('gd', [\n {type: 'heatmap', x: ['b','c'], y: ['x','y','z'], z: [[1,4],[2,5],[3,6]]},\n {type: 'heatmap', x: ['a'], y: ['x','y','z'], z: [[7],[8],[9]]}\n]);\n```\n**Expected**: column a at position 2, right next to c.\n**Actual**: column a is drawn at position 4, the axis range grows to [-0.5, 4.5], and there’s a gap. With 3 categories before it, it lands at 6. When the trace comes first (index 0), it looks correct.\n\n**Workaround**: numeric x with tickvals/ticktext.\n\nTested with plotly.js 4.1.1 (via plotly.py 7.1.0).\n\n### Screenshots/Video\n\n\u003cimg width=\"1396\" height=\"317\" alt=\"image\" src=\"https://github.com/user-attachments/assets/ac7081e9-db7f-431e-87e3-3bb85da45557\" />","author":{"url":"https://github.com/carlocastoldi","@type":"Person","name":"carlocastoldi"},"datePublished":"2026-11-18T14:21:59Z","url":"https://github.com/plotly/plotly.js/issues/8175"}
| 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:efe80bbd-39ab-0ae6-681a-c05dd77ba71a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E36E:311640:2ABDF27:365B740:6B01AE42 |
| html-safe-nonce | e59e019c2d93f348d400a3a7f975991a43e65323df3a381537132749d18cd2d7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMzZFOjMxMTY0MDoyQUJERjI3OjM2NUI3NDA6NkIwMUFFNDIiLCJ2aXNpdG9yX2lkIjoiNTE2MDA5Njg1NjUxMTk4MzE3MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c932cfe9cd39e6520039bd40f70fe7d8fdffa52144ae2df3099cf7064dc98ccc |
| hovercard-subject-tag | issue:6469267975 |
| 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.js/8175/issue_layout |
| twitter:image | https://opengraph.githubassets.com/70c4d33da8231639bab68ec683342365a85affb3cabd439d55213b8098bdd904/plotly/plotly.js/issues/8175 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/70c4d33da8231639bab68ec683342365a85affb3cabd439d55213b8098bdd904/plotly/plotly.js/issues/8175 |
| og:image:alt | Description When a heatmap trace has exactly one x value on a categorical x-axis, its column is drawn at twice the category’s index. This only shows when that category isn’t the first one on the ax... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | carlocastoldi |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/plotly/plotly.js git https://github.com/plotly/plotly.js.git |
| octolytics-dimension-user_id | 5997976 |
| octolytics-dimension-user_login | plotly |
| octolytics-dimension-repository_id | 45646037 |
| octolytics-dimension-repository_nwo | plotly/plotly.js |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 45646037 |
| octolytics-dimension-repository_network_root_nwo | plotly/plotly.js |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width