René's URL Explorer Experiment


Title: [FEATURE]: pixel-based spacing for subplot domains (so titles can't overlap the plot above) · Issue #7835 · plotly/plotly.js · GitHub

Open Graph Title: [FEATURE]: pixel-based spacing for subplot domains (so titles can't overlap the plot above) · Issue #7835 · plotly/plotly.js

X Title: [FEATURE]: pixel-based spacing for subplot domains (so titles can't overlap the plot above) · Issue #7835 · plotly/plotly.js

Description: Description Over in plotly.py there's a long-standing papercut with make_subplots: if you set a small vertical_spacing and also pass subplot_titles, the titles overlap the subplot above them (plotly/plotly.py#5606). The underlying limita...

Open Graph Description: Description Over in plotly.py there's a long-standing papercut with make_subplots: if you set a small vertical_spacing and also pass subplot_titles, the titles overlap the subplot above them (plotl...

X Description: Description Over in plotly.py there's a long-standing papercut with make_subplots: if you set a small vertical_spacing and also pass subplot_titles, the titles overlap the subplot above them (p...

Opengraph URL: https://github.com/plotly/plotly.js/issues/7835

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[FEATURE]: pixel-based spacing for subplot domains (so titles can't overlap the plot above)","articleBody":"### Description\n\nOver in plotly.py there's a long-standing papercut with `make_subplots`: if you set a small `vertical_spacing` and also pass `subplot_titles`, the titles overlap the subplot above them (plotly/plotly.py#5606).\n\nThe underlying limitation looks like it's in plotly.js. Subplot titles are paper-referenced annotations pinned to the top of each subplot's domain. Their height is a **pixel** quantity (it scales with font size), but `vertical_spacing` is expressed as a **plot fraction** and ends up as the gap between adjacent `domain` bands. So whether a title fits depends on the rendered pixel height of the plot area — which isn't known until draw time, and changes when the containing div is resized.\n\nThat's why this can't be solved cleanly on the plotly.py side: when `make_subplots` builds the figure it doesn't know the final height (it's often set later, or left responsive), so any fraction it picks for the gap is wrong at some height. The reporter flagged this directly in the original issue:\n\n> \"axis.domain only supports units of plot fraction, not sure if there is a way to shift it by a certain number of pixels.\"\n\nAnd @emilykl's steer on the plotly.py issue was:\n\n> \"in order to support this fix, Plotly.js will need to be modified to support pixel offsets for domain, or something along those lines... please open an issue in Plotly.js linking to this issue and proposing a change to the API.\"\n\nSo this is that issue. Since the final subplot layout is resolved at render time, this looks like the right layer to sort it out. There are two shapes this could take — I've laid out both below.\n\n**Approach A — let domain spacing carry a pixel component (resolved at draw time)**\n\nAllow the gap between subplot domains (or the domain bounds themselves) to be specified partly in pixels, resolved against the real plot-area size during layout, the same way `margin` already is. Conceptually it's `domain = fraction ± pixels`, with the pixel part applied when the actual height is known. This is general-purpose — anyone who needs a fixed-pixel gutter between subplots benefits, not just titled ones — and it's the most direct reading of \"pixel offsets for domain\".\n\n**Approach B — make subplot titles reserve their own space via the existing automargin machinery**\n\nInstead of a new public attribute, let subplot titles participate in the draw-time margin/automargin pass so each title reserves a pixel-sized band and pushes the neighbouring domain down at render time. No new config for users; the overlap just stops happening. The trade-off is that it shifts existing baselines automatically and is specific to titles rather than a general spacing primitive.\n\nApproach A is more general-purpose; Approach B has a smaller public API surface and reuses machinery that already exists. I'm not trying to prescribe an API here — the goal is to work out whether pixel-aware domain spacing, title-aware layout reservation, or some other render-time mechanism fits the existing layout model best. Happy with whichever direction the team prefers.\n\n### Why should this feature be added?\n\nThis is a common configuration (compact stacked subplots with titles — dashboards, multi-metric time series) and today it produces visibly broken output with no real workaround from the Python API. plotly.py can't fix it without this, because the decision depends on the rendered pixel height. A pixel-aware spacing primitive would close plotly/plotly.py#5606 and, more broadly, give anyone a way to reserve fixed-pixel space between subplots regardless of figure height.\n\n### Mocks/Designs\n\nMinimal repro (Python, but the overlap is produced by plotly.js at render time):\n\n```python\nfrom plotly.subplots import make_subplots\nimport plotly.graph_objects as go\nimport random\n\nfig = make_subplots(\n    rows=6, cols=1,\n    shared_xaxes=True,\n    vertical_spacing=0.02,\n    row_heights=[0.35, 0.13, 0.13, 0.13, 0.13, 0.13],\n    subplot_titles=['Heart Rate Variability', 'Walking', 'Cycling', 'Hiking', 'Other', 'Pilates'],\n)\nfor i in range(6):\n    fig.add_trace(\n        go.Scatter(x=[0, 1, 2], y=[random.randint(0, 10) for _ in range(3)]),\n        row=i + 1, col=1,\n    )\nfig.show()\n```\n\nEach title (a paper annotation at the top of its domain) grows upward into the small fraction gap above it. When that gap is small relative to the rendered pixel height of the title, the title overlaps the subplot above — and because the gap is a fraction while the title height is fixed pixels, whether it overlaps depends on the figure's rendered height. Screenshot of the overlap is on the linked issue: plotly/plotly.py#5606.\n\nSketch of the Approach A API (illustrative only):\n\n```\n// gap between subplot domains, resolved at draw time\ndomain: { ..., pad: 30 }     // 30px reserved, independent of figure height\n```\n\n### Notes\n\nplotly.js already does pixel-aware, draw-time layout in two places, which is why I think either approach is feasible without new machinery:\n\n- **`automargin`** grows the figure margins for long tick labels at render time, once pixel sizes are known.\n- **annotation `yshift` / `xshift`** are pixel offsets that already coexist with fractional/paper positioning.\n\nApproach B reuses the first directly; Approach A is the same idea generalised to domain spacing.\n\nLinked issue: plotly/plotly.py#5606. Happy to take a crack at the implementation once there's agreement on which direction to go.\n","author":{"url":"https://github.com/SharadhNaidu","@type":"Person","name":"SharadhNaidu"},"datePublished":"2026-06-10T18:28:59Z","url":"https://github.com/plotly/plotly.js/issues/7835"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:2ada434a-a050-9107-da16-d315042b03b0
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB1EA:ADA9D:3437EFC:42FEE70:6B01D453
html-safe-nonce06a8c7f6c8e1becbf72f96ac1fd909562affddc80acb41e0eccf6e9bf1b44106
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMUVBOkFEQTlEOjM0MzdFRkM6NDJGRUU3MDo2QjAxRDQ1MyIsInZpc2l0b3JfaWQiOiI4NDE1Nzg0ODE5Njc3NTgyNDE5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac661c022b62ef3bbd9905554341f14b0e7b6b858668c4e251c50beda1259f6f7f
hovercard-subject-tagissue:4633929277
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/plotly/plotly.js/7835/issue_layout
twitter:imagehttps://opengraph.githubassets.com/45f224ec84d8f784a887fd310bb0c33e80fb010a291e371bbf97a61303271f17/plotly/plotly.js/issues/7835
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/45f224ec84d8f784a887fd310bb0c33e80fb010a291e371bbf97a61303271f17/plotly/plotly.js/issues/7835
og:image:altDescription Over in plotly.py there's a long-standing papercut with make_subplots: if you set a small vertical_spacing and also pass subplot_titles, the titles overlap the subplot above them (plotl...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameSharadhNaidu
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/plotly/plotly.js git https://github.com/plotly/plotly.js.git
octolytics-dimension-user_id5997976
octolytics-dimension-user_loginplotly
octolytics-dimension-repository_id45646037
octolytics-dimension-repository_nwoplotly/plotly.js
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id45646037
octolytics-dimension-repository_network_root_nwoplotly/plotly.js
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/plotly/plotly.js/issues/7835#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fplotly%2Fplotly.js%2Fissues%2F7835
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fplotly%2Fplotly.js%2Fissues%2F7835
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=plotly%2Fplotly.js
Reloadhttps://github.com/plotly/plotly.js/issues/7835
Reloadhttps://github.com/plotly/plotly.js/issues/7835
Reloadhttps://github.com/plotly/plotly.js/issues/7835
plotlyhttps://github.com/plotly
plotly.jshttps://github.com/plotly/plotly.js
Codehttps://github.com/plotly/plotly.js
Issues726 (726)https://github.com/plotly/plotly.js/issues
Pull requests84 (84)https://github.com/plotly/plotly.js/pulls
Actionshttps://github.com/plotly/plotly.js/actions
Security and qualityhttps://github.com/plotly/plotly.js/security
Insightshttps://github.com/plotly/plotly.js/insights
https://github.com/plotly/plotly.js
New issuehttps://github.com/login?return_to=https://github.com/plotly/plotly.js/issues/7835
New issuehttps://github.com/login?return_to=https://github.com/plotly/plotly.js/issues/7835
#7965https://github.com/plotly/plotly.js/pull/7965
[FEATURE]: pixel-based spacing for subplot domains (so titles can't overlap the plot above)https://github.com/plotly/plotly.js/issues/7835#top
#7965https://github.com/plotly/plotly.js/pull/7965
https://github.com/emilykl
P2considered for next cyclehttps://github.com/plotly/plotly.js/issues?q=state%3Aopen%20label%3A%22P2%22
bugsomething brokenhttps://github.com/plotly/plotly.js/issues?q=state%3Aopen%20label%3A%22bug%22
size: 5https://github.com/plotly/plotly.js/issues?q=state%3Aopen%20label%3A%22size%3A%205%22
https://github.com/SharadhNaidu
SharadhNaiduhttps://github.com/SharadhNaidu
on Jun 10, 2026https://github.com/plotly/plotly.js/issues/7835#issue-4633929277
plotly/plotly.py#5606https://github.com/plotly/plotly.py/issues/5606
@emilyklhttps://github.com/emilykl
plotly/plotly.py#5606https://github.com/plotly/plotly.py/issues/5606
plotly/plotly.py#5606https://github.com/plotly/plotly.py/issues/5606
plotly/plotly.py#5606https://github.com/plotly/plotly.py/issues/5606
camdecosterhttps://github.com/camdecoster
emilyklhttps://github.com/emilykl
on Jun 25, 2026https://github.com/plotly/plotly.js/issues/7835#event-27218128697
robertclaushttps://github.com/robertclaus
bugsomething brokenhttps://github.com/plotly/plotly.js/issues?q=state%3Aopen%20label%3A%22bug%22
P2considered for next cyclehttps://github.com/plotly/plotly.js/issues?q=state%3Aopen%20label%3A%22P2%22
size: 5https://github.com/plotly/plotly.js/issues?q=state%3Aopen%20label%3A%22size%3A%205%22
on Aug 4, 2026https://github.com/plotly/plotly.js/issues/7835#event-28970594348
https://github.com/emilykl
emilyklhttps://github.com/emilykl
on Aug 9, 2026https://github.com/plotly/plotly.js/issues/7835#issuecomment-5232735009
@SharadhNaiduhttps://github.com/SharadhNaidu
https://github.com/SharadhNaidu
SharadhNaiduhttps://github.com/SharadhNaidu
on Aug 13, 2026https://github.com/plotly/plotly.js/issues/7835#issuecomment-5281963340
@emilyklhttps://github.com/emilykl
https://private-user-images.githubusercontent.com/185215496/635574414-22edb73f-26a5-47ff-bea4-bc6f94262189.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3OTUyODIzMDQsIm5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yMDI2MTEyMVQxNzI2NDRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT05ZGIzZWI0NTg3Mjk4NDVjYTQ0ZmZhMDIzMWRlZDQ5NmNjZTdlMzA2NTNiZjYzNDkxNWY0MjhjNTE5YzFiMTY0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZyZXNwb25zZS1jb250ZW50LXR5cGU9aW1hZ2UlMkZwbmcifQ.D-9V9XYpA-VgkhoHPtJlq6LHZexECHcX6U4xKdJxxHo
KoolADE85https://github.com/KoolADE85
on Nov 9, 2026https://github.com/plotly/plotly.js/issues/7835#event-35587171109
add domainpad for pixel spacing inside axis domainshttps://github.com/plotly/plotly.js/commit/33bb9f7cde53863804117b232a2abd6833f4d2ef
33bb9f7https://github.com/plotly/plotly.js/commit/33bb9f7cde53863804117b232a2abd6833f4d2ef
KoolADE85https://github.com/KoolADE85
completedhttps://github.com/plotly/plotly.js/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#7965https://github.com/plotly/plotly.js/pull/7965
on Nov 9, 2026https://github.com/plotly/plotly.js/issues/7835#event-35587171303
Sign up for freehttps://github.com/signup?return_to=https://github.com/plotly/plotly.js/issues/7835
Sign in to commenthttps://github.com/login?return_to=https://github.com/plotly/plotly.js/issues/7835
emilyklhttps://github.com/emilykl
P2considered for next cyclehttps://github.com/plotly/plotly.js/issues?q=state%3Aopen%20label%3A%22P2%22
bugsomething brokenhttps://github.com/plotly/plotly.js/issues?q=state%3Aopen%20label%3A%22bug%22
size: 5https://github.com/plotly/plotly.js/issues?q=state%3Aopen%20label%3A%22size%3A%205%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.