René's URL Explorer Experiment


Title: [Bug]: Secondary axis does not support Transform as functions · Issue #25691 · matplotlib/matplotlib · GitHub

Open Graph Title: [Bug]: Secondary axis does not support Transform as functions · Issue #25691 · matplotlib/matplotlib

X Title: [Bug]: Secondary axis does not support Transform as functions · Issue #25691 · matplotlib/matplotlib

Description: Bug summary The documentation for secondary_[xy]axis claims to accept a Transform for the functions parameter. However, the checks in set_functions do not accept Transform: matplotlib/lib/matplotlib/axes/_secondary_axes.py Lines 147 to 1...

Open Graph Description: Bug summary The documentation for secondary_[xy]axis claims to accept a Transform for the functions parameter. However, the checks in set_functions do not accept Transform: matplotlib/lib/matplotli...

X Description: Bug summary The documentation for secondary_[xy]axis claims to accept a Transform for the functions parameter. However, the checks in set_functions do not accept Transform: matplotlib/lib/matplotli...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Secondary axis does not support Transform as functions","articleBody":"### Bug summary\n\nThe [documentation for `secondary_[xy]axis`](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.secondary_xaxis.html#matplotlib.axes.Axes.secondary_xaxis) claims to accept a `Transform` for the `functions` parameter.\r\n\r\nHowever, the checks in `set_functions` do not accept `Transform`:\r\nhttps://github.com/matplotlib/matplotlib/blob/3f4d4c10d40c1c60e9572b5e4702a463e2a06747/lib/matplotlib/axes/_secondary_axes.py#L147-L158\r\n\r\nand any usage of the internal attribute seems to assume a tuple of callables:\r\nhttps://github.com/matplotlib/matplotlib/blob/3f4d4c10d40c1c60e9572b5e4702a463e2a06747/lib/matplotlib/axes/_secondary_axes.py#L193-L194\r\nhttps://github.com/matplotlib/matplotlib/blob/3f4d4c10d40c1c60e9572b5e4702a463e2a06747/lib/matplotlib/axes/_secondary_axes.py#L216\r\n\r\nBoth this documentation and the checks have been in the code since it was added in #11859.\n\n### Code for reproduction\n\n```python\nimport matplotlib.pyplot as plt\r\nfrom matplotlib.transforms import IdentityTransform\r\n\r\nfig, ax = plt.subplots()\r\nsecax = ax.secondary_xaxis('top', functions=IdentityTransform)\r\n# OR:\r\nsecax = ax.secondary_xaxis('top', functions=IdentityTransform())\r\n# OR:\r\nsecax = ax.secondary_xaxis('top', functions=(IdentityTransform, IdentityTransform))\r\n# OR:\r\nsecax = ax.secondary_xaxis('top', functions=(IdentityTransform(), IdentityTransform()))\n```\n\n\n### Actual outcome\n\nWith a single transform (class or object), _or_ a tuple of transform objects, it fails in the setter:\r\n```pytb\r\nTraceback (most recent call last):\r\n  File \"galleries/examples/subplots_axes_and_figures/secondary_axis.py\", line 40, in \u003cmodule\u003e\r\n    secax = ax.secondary_xaxis('top', functions=IdentityTransform)\r\n  File \"lib/matplotlib/axes/_axes.py\", line 586, in secondary_xaxis\r\n    secondary_ax = SecondaryAxis(self, 'x', location, functions,\r\n  File \"lib/matplotlib/axes/_secondary_axes.py\", line 42, in __init__\r\n    self.set_functions(functions)\r\n  File \"lib/matplotlib/axes/_secondary_axes.py\", line 155, in set_functions\r\n    raise ValueError('functions argument of secondary axes '\r\nValueError: functions argument of secondary axes must be a two-tuple of callable functions with the first function being the transform and the second being the inverse\r\n```\r\nWith a tuple of transform classes, the setter allows it, but it fails when drawing:\r\n```\r\nTraceback (most recent call last):\r\n  File \"lib/matplotlib/backends/backend_qt.py\", line 461, in _draw_idle\r\n    self.draw()\r\n  File \"lib/matplotlib/backends/backend_agg.py\", line 401, in draw\r\n    self.figure.draw(self.renderer)\r\n  File \"lib/matplotlib/artist.py\", line 95, in draw_wrapper\r\n    result = draw(artist, renderer, *args, **kwargs)\r\n  File \"lib/matplotlib/artist.py\", line 72, in draw_wrapper\r\n    return draw(artist, renderer)\r\n  File \"lib/matplotlib/figure.py\", line 3115, in draw\r\n    artists = self._get_draw_artists(renderer)\r\n  File \"lib/matplotlib/figure.py\", line 225, in _get_draw_artists\r\n    child.apply_aspect(\r\n  File \"lib/matplotlib/axes/_secondary_axes.py\", line 120, in apply_aspect\r\n    self._set_lims()\r\n  File \"lib/matplotlib/axes/_secondary_axes.py\", line 216, in _set_lims\r\n    lims = self._functions[0](np.array(lims))\r\n  File \"lib/matplotlib/transforms.py\", line 1759, in __init__\r\n    super().__init__(*args, **kwargs)\r\n  File \"lib/matplotlib/transforms.py\", line 125, in __init__\r\n    self._shorthand_name = shorthand_name or ''\r\nValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()\r\n```\n\n### Expected outcome\n\nAt least one of the options works, or it should not be documented as accepted.\n\n### Additional information\n\nI noticed this oddity in the types while reviewing #25224, but not sure what we intend here.\n\n### Operating system\n\n_No response_\n\n### Matplotlib Version\n\n3f4d4c10d40c1c60e9572b5e4702a463e2a06747\n\n### Matplotlib Backend\n\n_No response_\n\n### Python version\n\n_No response_\n\n### Jupyter version\n\n_No response_\n\n### Installation\n\ngit checkout","author":{"url":"https://github.com/QuLogic","@type":"Person","name":"QuLogic"},"datePublished":"2023-04-15T06:07:32.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/25691/matplotlib/issues/25691"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:eb9ab522-b127-721f-d3cb-3be4b3efd754
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB29C:814DC:4E094E:6751C0:6A52FF38
html-safe-nonceda5edcb7562730201fbac649e6fad16f71269c7c1bf100374ef795fa0eecd2cc
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjlDOjgxNERDOjRFMDk0RTo2NzUxQzA6NkE1MkZGMzgiLCJ2aXNpdG9yX2lkIjoiNDk5ODU4MDE0MDI3MzQ5OTk2MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac2f6f7c970e6bf84b0df9d45e7266959a3695aedbad15fb40dd998d44813bb3a5
hovercard-subject-tagissue:1669178265
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/25691/issue_layout
twitter:imagehttps://opengraph.githubassets.com/2e5363783de26ac75b86dba35654c75385722d079eb94394c4352bd155b60491/matplotlib/matplotlib/issues/25691
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/2e5363783de26ac75b86dba35654c75385722d079eb94394c4352bd155b60491/matplotlib/matplotlib/issues/25691
og:image:altBug summary The documentation for secondary_[xy]axis claims to accept a Transform for the functions parameter. However, the checks in set_functions do not accept Transform: matplotlib/lib/matplotli...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameQuLogic
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/25691#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F25691
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%2F25691
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/25691
Reloadhttps://github.com/matplotlib/matplotlib/issues/25691
Reloadhttps://github.com/matplotlib/matplotlib/issues/25691
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/25691
matplotlib https://github.com/matplotlib
matplotlibhttps://github.com/matplotlib/matplotlib
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/25691
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
#27267https://github.com/matplotlib/matplotlib/pull/27267
[Bug]: Secondary axis does not support Transform as functionshttps://github.com/matplotlib/matplotlib/issues/25691#top
#27267https://github.com/matplotlib/matplotlib/pull/27267
topic: ticks axis labelshttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22topic%3A%20ticks%20axis%20labels%22
v3.9.0https://github.com/matplotlib/matplotlib/milestone/78
https://github.com/QuLogic
QuLogichttps://github.com/QuLogic
on Apr 15, 2023https://github.com/matplotlib/matplotlib/issues/25691#issue-1669178265
documentation for secondary_[xy]axishttps://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.secondary_xaxis.html#matplotlib.axes.Axes.secondary_xaxis
matplotlib/lib/matplotlib/axes/_secondary_axes.pyhttps://github.com/matplotlib/matplotlib/blob/3f4d4c10d40c1c60e9572b5e4702a463e2a06747/lib/matplotlib/axes/_secondary_axes.py#L147-L158
3f4d4c1https://github.com/matplotlib/matplotlib/commit/3f4d4c10d40c1c60e9572b5e4702a463e2a06747
matplotlib/lib/matplotlib/axes/_secondary_axes.pyhttps://github.com/matplotlib/matplotlib/blob/3f4d4c10d40c1c60e9572b5e4702a463e2a06747/lib/matplotlib/axes/_secondary_axes.py#L193-L194
3f4d4c1https://github.com/matplotlib/matplotlib/commit/3f4d4c10d40c1c60e9572b5e4702a463e2a06747
matplotlib/lib/matplotlib/axes/_secondary_axes.pyhttps://github.com/matplotlib/matplotlib/blob/3f4d4c10d40c1c60e9572b5e4702a463e2a06747/lib/matplotlib/axes/_secondary_axes.py#L216
3f4d4c1https://github.com/matplotlib/matplotlib/commit/3f4d4c10d40c1c60e9572b5e4702a463e2a06747
#11859https://github.com/matplotlib/matplotlib/pull/11859
#25224https://github.com/matplotlib/matplotlib/pull/25224
3f4d4c1https://github.com/matplotlib/matplotlib/commit/3f4d4c10d40c1c60e9572b5e4702a463e2a06747
topic: ticks axis labelshttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22topic%3A%20ticks%20axis%20labels%22
v3.9.0https://github.com/matplotlib/matplotlib/milestone/78
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.