René's URL Explorer Experiment


Title: [MNT]: Consolidate tick API · Issue #29594 · matplotlib/matplotlib · GitHub

Open Graph Title: [MNT]: Consolidate tick API · Issue #29594 · matplotlib/matplotlib

X Title: [MNT]: Consolidate tick API · Issue #29594 · matplotlib/matplotlib

Description: Summary The Tick class/concept consistents of a ticklabel, a tickline (the marker) and a gridline. In addition there's the location as a fundmental property. We have a lot of methods to handle ticks. There are methods on Axis to configur...

Open Graph Description: Summary The Tick class/concept consistents of a ticklabel, a tickline (the marker) and a gridline. In addition there's the location as a fundmental property. We have a lot of methods to handle tick...

X Description: Summary The Tick class/concept consistents of a ticklabel, a tickline (the marker) and a gridline. In addition there's the location as a fundmental property. We have a lot of methods to handle ...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[MNT]: Consolidate tick API","articleBody":"### Summary\n\nThe Tick class/concept consistents of a *ticklabel*, a *tickline* (the marker) and a *gridline*. In addition there's the *location* as a fundmental property.\n\nWe have a lot of methods to handle ticks. There are methods on Axis to configure all these properties - often in flavors of major/minor and global (i.e. a function that lets you select major/minor/both). These methods would typically be used via `ax.xaxis.get_majorticklabels()`. Additionally, a subset of these wrappers is exposed on the Axes level, then in the flavors of x/y.\n\n![Image](https://github.com/user-attachments/assets/b6ceebf4-e6c5-4d5a-bb30-6225c1421fb3)\n\nOverall we have 16 such methods on Axes and 14 on Axis that directly work on Tick instances or parts of them.\n\n### Proposed fix\n\nWe should discourage direct interaction with ticks or their components (ticklabel, tickline, gridline). As ticks are volatile configuring the instances explicitly may not persist if the plot is changed later.\n\nTherefore, I would like to get rid of the high-level Axes methods that give access to these components: `get_xticklabels()`, `get_xmajorticklabels()`, `get_xminorticklabels()`, `get_xgridlines()`, `get_xticklines()` (and same for y).\n\nPeople should use `tick_params()` instead where possible, e.g.  `ax.tick_params(labelsize=10)` instead of  `for label in ax.get_xticklabels(): label.set_fontsize(10)`. This is not only shorter but also configures the common/universal tick property instead of individual volatile instances.\nSince `tick_params()` does currently not, and likely will never provide full control on all aspects (e.g. [this example](https://matplotlib.org/stable/gallery/event_handling/pick_event_demo.html#simple-picking-lines-rectangles-and-text) makes tick labels pickable), users should use the underlying Axis functions if they really must access the indivdual tick(components), i.e. use `ax.xaxis.get_ticklabels()` instead of ax.get_xticklabels()`.\n\nWhile removing this bunch of wrapper functions on Axes is massive API change, I think we eventually want to go there (slowly through a pending deprecation), because these functions are encouraging nowadays bad practice. - The weaker alternative would be to only discourage.\n\nConcrete:\n- pending deprecate the `Axes` methods: `get_xticklabels()`, `get_xmajorticklabels()`, `get_xminorticklabels()`, `get_xgridlines()`, `get_xticklines()` (and same for y).\n- Recommend to use `Axes.tick_params()` instead where possible.\n- Recommend to ues the respective `Axis` methods if more control is needed, e.g. `ax.xaxis.get_ticklabels()`\n- On all methods that return Tick components, warn that this only affects the current instances and future changes to the plot may create new ticks.\n\n---\nUsage statistics from GitHub query\nQuery string: `/\\.get_gridlines\\(/ NOT path:_base.py NOT path:axes.py NOT path:axis.py language:Python NOT is:fork NOT repo:matplotlib/matplotlib`\n\n![Image](https://github.com/user-attachments/assets/6a894008-5124-4929-8ea3-6063d4cb73c8)","author":{"url":"https://github.com/timhoffm","@type":"Person","name":"timhoffm"},"datePublished":"2025-02-08T09:38:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/29594/matplotlib/issues/29594"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:7899c364-504f-9346-ea01-5def5e7d130a
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAE2A:E05E1:636B7:827A1:6A526987
html-safe-nonce9bbce82cbdea25cb5e788cffaa18580aa3f259c6c54acef9eba16b65a2635605
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRTJBOkUwNUUxOjYzNkI3OjgyN0ExOjZBNTI2OTg3IiwidmlzaXRvcl9pZCI6IjMwMjE3NzIzODA4NzgwMzk0MzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacd56188b9cb9eccb5eadd70059673bb88788189a3c437046c53ccd9fddd8c8948
hovercard-subject-tagissue:2839742378
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/29594/issue_layout
twitter:imagehttps://opengraph.githubassets.com/179bc211d875570bfbb4267dd7c2f2b908012b2a2ada2793724a29ffc225788e/matplotlib/matplotlib/issues/29594
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/179bc211d875570bfbb4267dd7c2f2b908012b2a2ada2793724a29ffc225788e/matplotlib/matplotlib/issues/29594
og:image:altSummary The Tick class/concept consistents of a ticklabel, a tickline (the marker) and a gridline. In addition there's the location as a fundmental property. We have a lot of methods to handle tick...
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
release07a982c1d40157c619b364352b704c3ce66bb332
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/matplotlib/matplotlib/issues/29594#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F29594
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%2F29594
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/29594
Reloadhttps://github.com/matplotlib/matplotlib/issues/29594
Reloadhttps://github.com/matplotlib/matplotlib/issues/29594
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/29594
matplotlib https://github.com/matplotlib
matplotlibhttps://github.com/matplotlib/matplotlib
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/29594
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 408 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]: Consolidate tick APIhttps://github.com/matplotlib/matplotlib/issues/29594#top
Maintenancehttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22Maintenance%22
https://github.com/timhoffm
timhoffmhttps://github.com/timhoffm
on Feb 8, 2025https://github.com/matplotlib/matplotlib/issues/29594#issue-2839742378
https://private-user-images.githubusercontent.com/2836374/411210946-b6ceebf4-e6c5-4d5a-bb30-6225c1421fb3.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODM3ODYxNjQsIm5iZiI6MTc4Mzc4NTg2NCwicGF0aCI6Ii8yODM2Mzc0LzQxMTIxMDk0Ni1iNmNlZWJmNC1lNmM1LTRkNWEtYmIzMC02MjI1YzE0MjFmYjMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDcxMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjA3MTFUMTYwNDI0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OWVjYWU4ZTA2ZDVmNDkzYjJkNDhlYmViODgwYjlkNzNlNjE0OGYyMWFmNjNmNTE3NWZkMjgxNWM1NjQwYzNhZCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGcG5nIn0.1MlK4pmZL-ivI6kGmrNHobjAO9rw_O9S1KsxAFNCbE8
this examplehttps://matplotlib.org/stable/gallery/event_handling/pick_event_demo.html#simple-picking-lines-rectangles-and-text
https://private-user-images.githubusercontent.com/2836374/417034300-6a894008-5124-4929-8ea3-6063d4cb73c8.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODM3ODYxNjQsIm5iZiI6MTc4Mzc4NTg2NCwicGF0aCI6Ii8yODM2Mzc0LzQxNzAzNDMwMC02YTg5NDAwOC01MTI0LTQ5MjktOGVhMy02MDYzZDRjYjczYzgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDcxMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjA3MTFUMTYwNDI0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YzM0YmQ1YjRjZDhlZjk4Y2JhNzE2MzI0MTY4NDU4YTk4MGE2MGJiNTJmZmY5YzUyNWM1MDI4MjMzNzA3N2NlYiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGcG5nIn0.dj5MP4TY0OLD9zhVQiJ9o6xnjVC-nx7DkzEczDX15qI
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.