René's URL Explorer Experiment


Title: layout subplots has implicit magic, needs a better API · Issue #1436 · plotly/plotly.py · GitHub

Open Graph Title: layout subplots has implicit magic, needs a better API · Issue #1436 · plotly/plotly.py

X Title: layout subplots has implicit magic, needs a better API · Issue #1436 · plotly/plotly.py

Description: This issue refers to the example "Stacked Subplots with a Shared X-Axis". import plotly.plotly as py import plotly.graph_objs as go trace1 = go.Scatter( x=[0, 1, 2], y=[10, 11, 12] ) trace2 = go.Scatter( x=[2, 3, 4], y=[100, 110, 120], y...

Open Graph Description: This issue refers to the example "Stacked Subplots with a Shared X-Axis". import plotly.plotly as py import plotly.graph_objs as go trace1 = go.Scatter( x=[0, 1, 2], y=[10, 11, 12] ) trace2 = go.Sc...

X Description: This issue refers to the example "Stacked Subplots with a Shared X-Axis". import plotly.plotly as py import plotly.graph_objs as go trace1 = go.Scatter( x=[0, 1, 2], y=[10, 11, 12] ) trac...

Opengraph URL: https://github.com/plotly/plotly.py/issues/1436

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"layout subplots has implicit magic, needs a better API","articleBody":"This issue refers to the example \"Stacked Subplots with a Shared X-Axis\".\r\n\r\n```\r\nimport plotly.plotly as py\r\nimport plotly.graph_objs as go\r\n\r\ntrace1 = go.Scatter(\r\n    x=[0, 1, 2],\r\n    y=[10, 11, 12]\r\n)\r\ntrace2 = go.Scatter(\r\n    x=[2, 3, 4],\r\n    y=[100, 110, 120],\r\n    yaxis='y2'\r\n)\r\ntrace3 = go.Scatter(\r\n    x=[3, 4, 5],\r\n    y=[1000, 1100, 1200],\r\n    yaxis='y3'\r\n)\r\ndata = [trace1, trace2, trace3]\r\nlayout = go.Layout(\r\n    yaxis=dict(\r\n        domain=[0, 0.33]\r\n    ),\r\n    legend=dict(\r\n        traceorder='reversed'\r\n    ),\r\n    yaxis2=dict(\r\n        domain=[0.33, 0.66]\r\n    ),\r\n    yaxis3=dict(\r\n        domain=[0.66, 1]\r\n    )\r\n)\r\nfig = go.Figure(data=data, layout=layout)\r\npy.iplot(fig, filename='stacked-subplots-shared-x-axis')\r\n```\r\n\r\nFirst of all, I know that `make_subplots` abstracts a lot of this magic away, but the second I want finer control of my plot (e.g., more than just a grid or some shared axes), I need to use the layout object. \r\n\r\nThe implicit mapping of a trace from `yaxis='y2'` to the axis `yaxis2` is a bit too magical for me. The name of the axis that you give a trace doesn't match the name of the axis in the layout (`x` vs `xaxis`, `y2` vs `yaxis2`, etc.).  Also, the name of the first axis doesn't have a number, e.g., `x`, `x2`, ... and `xaxis`, `xaxis2`, ... . As far as I can tell, this is only documented by example. I had to reverse engineer it from the example and by examining the layout object after much trial and error. \r\n\r\nIdeally, an axis would be a first-class object with a unique identifier. A default name like `xaxis1`, `yaxis3` is fine (as long as the naming convention is consistent for all), but it would also be nice to allow custom names that are even more meaningful. \r\n\r\nThe top-level separation between a list of traces and a layout that define a figure is confusing once subplots are involved. There is a natural relationship between a _trace_, _axes_, and _axis_. An _axes_ should have x and y (or z) _axis_. An _axes_ should have one or more _trace_ children.\r\n\r\nI'd like to see the API look more like this:\r\n\r\n```\r\nfig = go.Figure(...)\r\nax = fig.add_axes(...) . # create a custom subplot\r\nax.add_trace(go.Trace(...))  # add a trace to an axes\r\n```\r\n\r\nThere could be some convenience functions:\r\n\r\n```\r\nax = fig.axes  # default axes\r\nfig.add_trace(go.Trace(...))  # equivalent to fig.axes.add_trace()\r\n\r\nax00, ax01, ax10, ax11 = fig.make_subplots(rows=2, cols=2)\r\n```\r\n\r\nOnce the API is more object-oriented, you can do cool things like add a _trace_ to more than one _axes_, and share _axis_ objects between _axes_. In the JSON representation, these would be defined once and referenced elsewhere by unique name.\r\n\r\nThese are just suggestions. Obviously there are many corner cases and backward compatibility that would have to be addressed.\r\n\r\nThe bottom line is that the current API is not intuitive and not well documented, therefore hard to use.\r\n","author":{"url":"https://github.com/jthornbrue","@type":"Person","name":"jthornbrue"},"datePublished":"2019-02-14T16:41:42Z","url":"https://github.com/plotly/plotly.py/issues/1436"}

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:d604fe78-5e27-07c3-9389-b0711cd07c06
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBB9E:136CDA:381F03:4A8599:6B0193F4
html-safe-noncea973b57da94f456d2903bb481316f4cd219c68bea4e74b496097405ce3276da0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQjlFOjEzNkNEQTozODFGMDM6NEE4NTk5OjZCMDE5M0Y0IiwidmlzaXRvcl9pZCI6IjYwOTE4MzQyNTQxMTM3Mzk3NjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac0d42936d26281547731a930cc4f0ef12b65aa12f3061851b4eb1e2a127d30dba
hovercard-subject-tagissue:410390131
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.py/1436/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3d8aef359ce976354c497ba00fcb44377cf4ea92f10e8f61afbfc0d5c963e1a3/plotly/plotly.py/issues/1436
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3d8aef359ce976354c497ba00fcb44377cf4ea92f10e8f61afbfc0d5c963e1a3/plotly/plotly.py/issues/1436
og:image:altThis issue refers to the example "Stacked Subplots with a Shared X-Axis". import plotly.plotly as py import plotly.graph_objs as go trace1 = go.Scatter( x=[0, 1, 2], y=[10, 11, 12] ) trace2 = go.Sc...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejthornbrue
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/plotly/plotly.py git https://github.com/plotly/plotly.py.git
octolytics-dimension-user_id5997976
octolytics-dimension-user_loginplotly
octolytics-dimension-repository_id14579099
octolytics-dimension-repository_nwoplotly/plotly.py
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id14579099
octolytics-dimension-repository_network_root_nwoplotly/plotly.py
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.py/issues/1436#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fplotly%2Fplotly.py%2Fissues%2F1436
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.py%2Fissues%2F1436
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.py
Reloadhttps://github.com/plotly/plotly.py/issues/1436
Reloadhttps://github.com/plotly/plotly.py/issues/1436
Reloadhttps://github.com/plotly/plotly.py/issues/1436
plotlyhttps://github.com/plotly
plotly.pyhttps://github.com/plotly/plotly.py
Codehttps://github.com/plotly/plotly.py
Issues650 (650)https://github.com/plotly/plotly.py/issues
Pull requests83 (83)https://github.com/plotly/plotly.py/pulls
Actionshttps://github.com/plotly/plotly.py/actions
Security and qualityhttps://github.com/plotly/plotly.py/security
Insightshttps://github.com/plotly/plotly.py/insights
https://github.com/plotly/plotly.py
New issuehttps://github.com/login?return_to=https://github.com/plotly/plotly.py/issues/1436
New issuehttps://github.com/login?return_to=https://github.com/plotly/plotly.py/issues/1436
layout subplots has implicit magic, needs a better APIhttps://github.com/plotly/plotly.py/issues/1436#top
https://github.com/jthornbrue
jthornbruehttps://github.com/jthornbrue
on Feb 14, 2019https://github.com/plotly/plotly.py/issues/1436#issue-410390131
https://github.com/jonmmease
jonmmeasehttps://github.com/jonmmease
on Feb 19, 2019https://github.com/plotly/plotly.py/issues/1436#issuecomment-465100755
@jthornbruehttps://github.com/jthornbrue
plotly/plotly.js#3507https://github.com/plotly/plotly.js/issues/3507
plotly/plotly.js#3506https://github.com/plotly/plotly.js/pull/3506
jonmmeasehttps://github.com/jonmmease
make_subplotshttps://github.com/plotly/plotly.py/issues?q=state%3Aopen%20label%3A%22make_subplots%22
V4https://github.com/plotly/plotly.py/issues?q=state%3Aopen%20label%3A%22V4%22
on Feb 19, 2019https://github.com/plotly/plotly.py/issues/1436#event-2148627910
jonmmeasehttps://github.com/jonmmease
enhancementhttps://github.com/plotly/plotly.py/issues?q=state%3Aopen%20label%3A%22enhancement%22
V4https://github.com/plotly/plotly.py/issues?q=state%3Aopen%20label%3A%22V4%22
on Jun 15, 2019https://github.com/plotly/plotly.py/issues/1436#event-2415530227
https://github.com/gvwilson
gvwilsonhttps://github.com/gvwilson
on Jun 13, 2024https://github.com/plotly/plotly.py/issues/1436#issuecomment-2166609353
@gvwilsonhttps://github.com/gvwilson
gvwilsonhttps://github.com/gvwilson
completedhttps://github.com/plotly/plotly.py/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jun 13, 2024https://github.com/plotly/plotly.py/issues/1436#event-13151828125
https://github.com/chanansh
chananshhttps://github.com/chanansh
on Jan 28, 2025https://github.com/plotly/plotly.py/issues/1436#issuecomment-2619728054
Sign up for freehttps://github.com/signup?return_to=https://github.com/plotly/plotly.py/issues/1436
Sign in to commenthttps://github.com/login?return_to=https://github.com/plotly/plotly.py/issues/1436
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.