René's URL Explorer Experiment


Title: [MNT]: Refactor data limits · Issue #30342 · matplotlib/matplotlib · GitHub

Open Graph Title: [MNT]: Refactor data limits · Issue #30342 · matplotlib/matplotlib

X Title: [MNT]: Refactor data limits · Issue #30342 · matplotlib/matplotlib

Description: Summary For now, this is a ticket to collect my thoughts. It's not completely thought though and therefore not yet actionable. Data limits are stored in Axes.dataLim and updated via a push-mechanism (plotting functions that add artists a...

Open Graph Description: Summary For now, this is a ticket to collect my thoughts. It's not completely thought though and therefore not yet actionable. Data limits are stored in Axes.dataLim and updated via a push-mechanis...

X Description: Summary For now, this is a ticket to collect my thoughts. It's not completely thought though and therefore not yet actionable. Data limits are stored in Axes.dataLim and updated via a push-mech...

Opengraph URL: https://github.com/matplotlib/matplotlib/issues/30342

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[MNT]: Refactor data limits","articleBody":"### Summary\n\nFor now, this is a ticket to collect my thoughts. It's not completely thought though and therefore not yet actionable.\n\nData limits are stored in `Axes.dataLim` and updated via a push-mechanism (plotting functions that add artists also update the data limits). This has several disadvantages:\n- Changes to the data within an Artist cannot be automatically be picked up; one needs to explicitly call `Axes.relim`.\n- Syncing dataLim for shared axes is tedious\n- The concept does not work well with clearing shared axes (https://github.com/matplotlib/matplotlib/issues/28851#issuecomment-2371603978).\n\n### Proposed fix\n\nWe should rearchitect data limit handling:\n\nBreak the strong coupling between Axes and data limits: Create a `_DataLimits` class that does all the limit related operations:\n```\nclass _DataLimits:\n    def __init__(axes):\n          self.axes = axes\n          self.datalim = BBox.null()\n    \n   def relim(...):\n         # pull pull code from Axes.relim in here\n```\nand remove it from Axes\n```\nclass AxesBase:\n    def __init__(...):\n        [...]\n        self._datalimits = _DataLimits(self)\n        # remove self.dataLim\n\n    @property\n    def dataLim(self):\n        return self._datalimits.dataLim\n\n    @dataLim.setter\n    def dataLim(self, lim):\n        self._datalimits.dataLim = lim\n\n    def relim(...):\n         self._datalimits.relim(....)\n```\n\nWhen we have managed this, we can improve:\n- DataLimits could handle multiple Axes. This allows much better handling of sharing We can then have one DataLimits instance, which collects data information from multiple Axes. This single DataLimits instance is used on all shared Axes. (Note: We likely have to have separate DataLimits objects for x and y to support all kinds of sharing)\n- We can make DataLimits lazy - they are just called from the Axes now. All the state handling is encapsulated in DataLimits. (Possibly, combined with a refactoring so that we can query Artists for their data limits. - Then `_DataLimits` just has to loop over all artists on all handled Axes and collect the limit information.\n\n---\n\n*Edit:* Thinking about it a bit more: data limits should not be shared - they are an individual property of the respective Axes. What needs synchronization / sharing on `sharex/y` is view limits.\n\nSince `Axes.dataLim` is public, people can write to it (either replace the whole instance or update its attributes). Properly shielding against that is quite a hassle, because we'd need to have an immuatble BBox. So for the time being, we are bound to `dataLim` as BBox being the data representation. That combined with the realization that data limits should not be shared implies there's likely not a large benefit in refactoring.\n\nSharing should be handled on the level view limits.\n\nWe can still make the data limits lazy - as we do with `viewLim` https://github.com/matplotlib/matplotlib/blob/b2e8b936e057ffc7b0d1505c5703988172041d4b/lib/matplotlib/axes/_base.py#L889-893.","author":{"url":"https://github.com/timhoffm","@type":"Person","name":"timhoffm"},"datePublished":"2025-07-22T14:33:00.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/30342/matplotlib/issues/30342"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:186ed466-14c2-ba35-084a-aad5f0913a02
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE590:183DA9:11407A3:1793F17:6A521352
html-safe-noncea8650f3bd6d9e74141dbadfa75c6917efa7772f774d018ba31ad507522a161b2
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTkwOjE4M0RBOToxMTQwN0EzOjE3OTNGMTc6NkE1MjEzNTIiLCJ2aXNpdG9yX2lkIjoiODA2NjM1NDUxMzkxNTgxMDY0MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac630427f532c17d1d3c9e90c3687b2f326308be2b4187a921722c1ac5e8f836a2
hovercard-subject-tagissue:3252942079
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/matplotlib/matplotlib/30342/issue_layout
twitter:imagehttps://opengraph.githubassets.com/8059d0fd2759190d61f3f12abb09ca98bf61e5f23e6da37a7dbdcc740f30b91a/matplotlib/matplotlib/issues/30342
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/8059d0fd2759190d61f3f12abb09ca98bf61e5f23e6da37a7dbdcc740f30b91a/matplotlib/matplotlib/issues/30342
og:image:altSummary For now, this is a ticket to collect my thoughts. It's not completely thought though and therefore not yet actionable. Data limits are stored in Axes.dataLim and updated via a push-mechanis...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernametimhoffm
hostnamegithub.com
expected-hostnamegithub.com
Noneb9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb
turbo-cache-controlno-preview
go-importgithub.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git
octolytics-dimension-user_id215947
octolytics-dimension-user_loginmatplotlib
octolytics-dimension-repository_id1385122
octolytics-dimension-repository_nwomatplotlib/matplotlib
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1385122
octolytics-dimension-repository_network_root_nwomatplotlib/matplotlib
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
release7aed05249554b889eb33d002851a973eebcc7e91
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/matplotlib/matplotlib/issues/30342#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F30342
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F30342
Sign up https://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=matplotlib%2Fmatplotlib
Reloadhttps://github.com/matplotlib/matplotlib/issues/30342
Reloadhttps://github.com/matplotlib/matplotlib/issues/30342
Reloadhttps://github.com/matplotlib/matplotlib/issues/30342
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/30342
matplotlib https://github.com/matplotlib
matplotlibhttps://github.com/matplotlib/matplotlib
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/30342
Notifications https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Fork 8.4k https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Star 23k https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Code https://github.com/matplotlib/matplotlib
Issues 1.1k https://github.com/matplotlib/matplotlib/issues
Pull requests 409 https://github.com/matplotlib/matplotlib/pulls
Actions https://github.com/matplotlib/matplotlib/actions
Projects https://github.com/matplotlib/matplotlib/projects
Wiki https://github.com/matplotlib/matplotlib/wiki
Security and quality 0 https://github.com/matplotlib/matplotlib/security
Insights https://github.com/matplotlib/matplotlib/pulse
Code https://github.com/matplotlib/matplotlib
Issues https://github.com/matplotlib/matplotlib/issues
Pull requests https://github.com/matplotlib/matplotlib/pulls
Actions https://github.com/matplotlib/matplotlib/actions
Projects https://github.com/matplotlib/matplotlib/projects
Wiki https://github.com/matplotlib/matplotlib/wiki
Security and quality https://github.com/matplotlib/matplotlib/security
Insights https://github.com/matplotlib/matplotlib/pulse
[MNT]: Refactor data limitshttps://github.com/matplotlib/matplotlib/issues/30342#top
Maintenancehttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22Maintenance%22
https://github.com/timhoffm
timhoffmhttps://github.com/timhoffm
on Jul 22, 2025https://github.com/matplotlib/matplotlib/issues/30342#issue-3252942079
[MNT]: Define Axes.clear semantics #28851 (comment)https://github.com/matplotlib/matplotlib/issues/28851#issuecomment-2371603978
https://github.com/matplotlib/matplotlib/blob/b2e8b936e057ffc7b0d1505c5703988172041d4b/lib/matplotlib/axes/_base.py#L889-893https://github.com/matplotlib/matplotlib/blob/b2e8b936e057ffc7b0d1505c5703988172041d4b/lib/matplotlib/axes/_base.py#L889-893
Maintenancehttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22Maintenance%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.