René's URL Explorer Experiment


Title: Cartopy axes_grid_basic example broken by Matplotlib 3.6 · Issue #24053 · matplotlib/matplotlib · GitHub

Open Graph Title: Cartopy axes_grid_basic example broken by Matplotlib 3.6 · Issue #24053 · matplotlib/matplotlib

X Title: Cartopy axes_grid_basic example broken by Matplotlib 3.6 · Issue #24053 · matplotlib/matplotlib

Description: Cartopy's axes_grid_basic was broken by Matplotlib 3.6. The relevant call is: axgr = AxesGrid(fig, 111, axes_class=axes_class, nrows_ncols=(3, 2), axes_pad=0.6, cbar_location='right', cbar_mode='single', cbar_pad=0.2, cbar_size='3%', lab...

Open Graph Description: Cartopy's axes_grid_basic was broken by Matplotlib 3.6. The relevant call is: axgr = AxesGrid(fig, 111, axes_class=axes_class, nrows_ncols=(3, 2), axes_pad=0.6, cbar_location='right', cbar_mode='si...

X Description: Cartopy's axes_grid_basic was broken by Matplotlib 3.6. The relevant call is: axgr = AxesGrid(fig, 111, axes_class=axes_class, nrows_ncols=(3, 2), axes_pad=0.6, cbar_location='right', c...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Cartopy axes_grid_basic example broken by Matplotlib 3.6","articleBody":"Cartopy's [axes_grid_basic](https://scitools.org.uk/cartopy/docs/latest/gallery/miscellanea/axes_grid_basic.html) was broken by Matplotlib 3.6. The relevant call is:\r\n```python\r\n    axgr = AxesGrid(fig, 111, axes_class=axes_class,\r\n                    nrows_ncols=(3, 2),\r\n                    axes_pad=0.6,\r\n                    cbar_location='right',\r\n                    cbar_mode='single',\r\n                    cbar_pad=0.2,\r\n                    cbar_size='3%',\r\n                    label_mode='')  # note the empty label_mode\r\n```\r\n\r\nIn #23550, we began explicitly checking for the documented values of `label_mode`, (`'All', 'L', '1'`), which this runs afoul of. It appears the previous code let `''` (or any option not handled) essentially work as a noop for `set_label_mode()`.\r\n\r\nBased on the output when the example worked, `'1'` would be fine behavior-wise, but that currently produces in this example:\r\n```pytb\r\n/Users/rmay/repos/cartopy/examples/miscellanea/axes_grid_basic.py:48: MatplotlibDeprecationWarning: The resize_event function was deprecated in Matplotlib 3.6 and will be removed two minor releases later. Use callbacks.process('resize_event', ResizeEvent(...)) instead.\r\n  fig = plt.figure()\r\nTraceback (most recent call last):\r\n  File \"/Users/rmay/repos/cartopy/examples/miscellanea/axes_grid_basic.py\", line 78, in \u003cmodule\u003e\r\n    main()\r\n  File \"/Users/rmay/repos/cartopy/examples/miscellanea/axes_grid_basic.py\", line 49, in main\r\n    axgr = AxesGrid(fig, 111,\r\n  File \"/Users/rmay/miniconda3/envs/py310/lib/python3.10/site-packages/mpl_toolkits/axes_grid1/axes_grid.py\", line 391, in __init__\r\n    super().__init__(\r\n  File \"/Users/rmay/miniconda3/envs/py310/lib/python3.10/site-packages/mpl_toolkits/axes_grid1/axes_grid.py\", line 174, in __init__\r\n    self.set_label_mode(label_mode)\r\n  File \"/Users/rmay/miniconda3/envs/py310/lib/python3.10/site-packages/mpl_toolkits/axes_grid1/axes_grid.py\", line 295, in set_label_mode\r\n    _tick_only(ax, bottom_on=True, left_on=True)\r\n  File \"/Users/rmay/miniconda3/envs/py310/lib/python3.10/site-packages/mpl_toolkits/axes_grid1/axes_grid.py\", line 16, in _tick_only\r\n    ax.axis[\"bottom\"].toggle(ticklabels=bottom_off, label=bottom_off)\r\nTypeError: 'method' object is not subscriptable\r\n```\r\n\r\nThis is because, while `AxesGrid` supposedly supports arbitrary classes by passing `axes_class`, there's a huge caveat: the default is `mpl_toolkits.axes_grid1.mpl_axes.Axes` (TERRIBLY CONFUSING NAME--it's imported as just `Axes` in `axis_grid.py`). This is a custom subclass that adds:\r\n\r\n```python\r\n    @property\r\n    def axis(self):\r\n        return self._axislines\r\n\r\n    def clear(self):\r\n        # docstring inherited\r\n        super().clear()\r\n        # Init axis artists.\r\n        self._axislines = self.AxisDict(self)\r\n        self._axislines.update(\r\n            bottom=SimpleAxisArtist(self.xaxis, 1, self.spines[\"bottom\"]),\r\n            top=SimpleAxisArtist(self.xaxis, 2, self.spines[\"top\"]),\r\n            left=SimpleAxisArtist(self.yaxis, 1, self.spines[\"left\"]),\r\n            right=SimpleAxisArtist(self.yaxis, 2, self.spines[\"right\"]))\r\n```\r\n\r\nOptions I can think of:\r\n1. Restore a noop option for `set_label_mode`\r\n2. Fix `AxesGrid` to work more generally with `axes_class`--monkey-patch/subclass to add the necessary modifications\r\n3. Document that `axes_class` needs to have certain behavior\r\n4. Fix `AxesGrid` to not rely on a property that OVERRIDES `matplotlib.axes.Axes.axis` with a *different type* that also manually dispatches to the unbound `axis()` method :scream: \r\n```python\r\n    class AxisDict(dict):\r\n        def __init__(self, axes):\r\n            self.axes = axes\r\n            super().__init__()\r\n\r\n        def __getitem__(self, k):\r\n            if isinstance(k, tuple):\r\n                r = SimpleChainedObjects(\r\n                    # super() within a list comprehension needs explicit args.\r\n                    [super(Axes.AxisDict, self).__getitem__(k1) for k1 in k])\r\n                return r\r\n            elif isinstance(k, slice):\r\n                if k.start is None and k.stop is None and k.step is None:\r\n                    return SimpleChainedObjects(list(self.values()))\r\n                else:\r\n                    raise ValueError(\"Unsupported slice\")\r\n            else:\r\n                return dict.__getitem__(self, k)\r\n\r\n        def __call__(self, *v, **kwargs):\r\n            return maxes.Axes.axis(self.axes, *v, **kwargs)\r\n```\r\n\r\nAnyone have any opinions?","author":{"url":"https://github.com/dopplershift","@type":"Person","name":"dopplershift"},"datePublished":"2022-09-29T18:46:21.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":15},"url":"https://github.com/24053/matplotlib/issues/24053"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:67377ac9-5b84-4ce8-0d6f-19947ed62494
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id96BE:14F57:36A25:4BD1A:6A50EA7E
html-safe-nonce5ef3172d99b2a07153ec186f513869b81075dbb7ab73e568522b36a747cadbcf
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NkJFOjE0RjU3OjM2QTI1OjRCRDFBOjZBNTBFQTdFIiwidmlzaXRvcl9pZCI6IjY1OTE3MDg2ODcxODE2MDU1MDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac7afbed77c304630e332f897c5baeda7d4309ec83205312994086c7e08b88b2c5
hovercard-subject-tagissue:1391335444
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/24053/issue_layout
twitter:imagehttps://opengraph.githubassets.com/846d312401148cfce6bc0f511546def8c19bea4d96991009744ebc5b0637afc2/matplotlib/matplotlib/issues/24053
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/846d312401148cfce6bc0f511546def8c19bea4d96991009744ebc5b0637afc2/matplotlib/matplotlib/issues/24053
og:image:altCartopy's axes_grid_basic was broken by Matplotlib 3.6. The relevant call is: axgr = AxesGrid(fig, 111, axes_class=axes_class, nrows_ncols=(3, 2), axes_pad=0.6, cbar_location='right', cbar_mode='si...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedopplershift
hostnamegithub.com
expected-hostnamegithub.com
None72b13e0e8d0319acdd27a145cfe73f4f06c791713d0ac4690e41fb68ad28cac0
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
releasefb19d617b534959801b4b7453938ecf1dfa22131
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/matplotlib/matplotlib/issues/24053#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F24053
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%2F24053
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/24053
Reloadhttps://github.com/matplotlib/matplotlib/issues/24053
Reloadhttps://github.com/matplotlib/matplotlib/issues/24053
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/24053
matplotlib https://github.com/matplotlib
matplotlibhttps://github.com/matplotlib/matplotlib
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/24053
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 410 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
Cartopy axes_grid_basic example broken by Matplotlib 3.6https://github.com/matplotlib/matplotlib/issues/24053#top
topic: mpl_toolkithttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22topic%3A%20mpl_toolkit%22
v3.6.1https://github.com/matplotlib/matplotlib/milestone/73
https://github.com/dopplershift
dopplershifthttps://github.com/dopplershift
on Sep 29, 2022https://github.com/matplotlib/matplotlib/issues/24053#issue-1391335444
axes_grid_basichttps://scitools.org.uk/cartopy/docs/latest/gallery/miscellanea/axes_grid_basic.html
#23550https://github.com/matplotlib/matplotlib/pull/23550
topic: mpl_toolkithttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22topic%3A%20mpl_toolkit%22
v3.6.1https://github.com/matplotlib/matplotlib/milestone/73
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.