René's URL Explorer Experiment


Title: [Bug]: no longer able to set multiple hatch colors · Issue #28990 · matplotlib/matplotlib · GitHub

Open Graph Title: [Bug]: no longer able to set multiple hatch colors · Issue #28990 · matplotlib/matplotlib

X Title: [Bug]: no longer able to set multiple hatch colors · Issue #28990 · matplotlib/matplotlib

Description: Bug summary Possible bug or maybe a usage issue following some recent updates... In short, it used to be possible to set the hatch color for each filled contour area to a different color by iterating over the collections and then setting...

Open Graph Description: Bug summary Possible bug or maybe a usage issue following some recent updates... In short, it used to be possible to set the hatch color for each filled contour area to a different color by iterati...

X Description: Bug summary Possible bug or maybe a usage issue following some recent updates... In short, it used to be possible to set the hatch color for each filled contour area to a different color by iterati...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: no longer able to set multiple hatch colors","articleBody":"### Bug summary\n\nPossible bug or maybe a usage issue following some recent updates...\r\n\r\nIn short, it used to be possible to set the hatch color for each filled contour area to a different color by iterating over the collections and then setting the edgecolor for each, but that's no longer the case with Matplotlib 3.10 and the removal of collections.  \r\n\r\nI've been trying to find a workaround after the recent updates, but am struggling a bit.  Using `set_edgecolors` only sets a single hatch color for all filled contours (which seems unexpected based upon the docs and like a potential bug) and rcParams['hatch.color'] also just sets a single color (less suprising).\r\n\r\nIt's entirely possible I'm missing something here, but didn't see much in the docs to help either. \n\n### Code for reproduction\n\n```Python\n# The new approach I was hoping would work, but got unexpected results from\r\n\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\n\r\n# invent some numbers, turning the x and y arrays into simple\r\n# 2d arrays, which make combining them together easier.\r\nx = np.linspace(-3, 5, 150).reshape(1, -1)\r\ny = np.linspace(-3, 5, 120).reshape(-1, 1)\r\nz = np.cos(x) + np.sin(y)\r\n\r\n# we no longer need x and y to be 2 dimensional, so flatten them.\r\nx, y = x.flatten(), y.flatten()\r\n\r\nfig1, ax1 = plt.subplots()\r\ncs = ax1.contourf(x, y, z, hatches=['-', '/', '\\\\', '//'],\r\n                  cmap='gray', extend='both', alpha=0.5)\r\n\r\ncs.set_edgecolors([\"blue\",\"grey\",\"yellow\",\"red\"])\r\nfig1.colorbar(cs)\r\n\r\n\r\n\r\n# The older approach that now fails with Matplotlib 3.10\r\n\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\n\r\n# invent some numbers, turning the x and y arrays into simple\r\n# 2d arrays, which make combining them together easier.\r\nx = np.linspace(-3, 5, 150).reshape(1, -1)\r\ny = np.linspace(-3, 5, 120).reshape(-1, 1)\r\nz = np.cos(x) + np.sin(y)\r\n\r\n# we no longer need x and y to be 2 dimensional, so flatten them.\r\nx, y = x.flatten(), y.flatten()\r\n\r\nfig1, ax1 = plt.subplots()\r\ncs = ax1.contourf(x, y, z, hatches=['-', '/', '\\\\', '//'],\r\n                  cmap='gray', extend='both', alpha=0.5)\r\n\r\ncolors = [\"blue\",\"grey\",\"yellow\",\"red\"]\r\nfor i, collection in enumerate(cs.collections):\r\n    collection.set_edgecolor(colors[i % len(colors)])\r\nfig1.colorbar(cs)\n```\n\n\n### Actual outcome\n\n\u003cimg width=\"581\" alt=\"Screen Shot 2024-10-17 at 4 19 18 PM\" src=\"https://github.com/user-attachments/assets/6c2306b5-196b-4488-b02d-2175df0f3238\"\u003e\r\n\n\n### Expected outcome\n\n\u003cimg width=\"589\" alt=\"Screen Shot 2024-10-17 at 4 18 22 PM\" src=\"https://github.com/user-attachments/assets/705fc1c6-7e35-46c8-a815-5e3f57458b0a\"\u003e\r\n\n\n### Additional information\n\n_No response_\n\n### Operating system\n\nOS/X\n\n### Matplotlib Version\n\n3.9.2\n\n### Matplotlib Backend\n\n'module://matplotlib_inline.backend_inline'\n\n### Python version\n\n3.11.7\n\n### Jupyter version\n\n4.0.9\n\n### Installation\n\nconda","author":{"url":"https://github.com/kafitzgerald","@type":"Person","name":"kafitzgerald"},"datePublished":"2024-10-17T22:21:16.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/28990/matplotlib/issues/28990"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:a0349adc-248d-7e3d-0731-d9116512adc5
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA858:101A9F:D9B195:12163A4:6A532B77
html-safe-nonce4b20953f5f6f702c58d481c42620790071751f681f84deb191b6d9200e527665
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBODU4OjEwMUE5RjpEOUIxOTU6MTIxNjNBNDo2QTUzMkI3NyIsInZpc2l0b3JfaWQiOiIxNzQ0MTY5NTcyMjcwODQ2NjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacf3927a27b11942b188514507029ad2ba6803aad206331f85dc8fe7e18e132afd
hovercard-subject-tagissue:2595871298
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/28990/issue_layout
twitter:imagehttps://opengraph.githubassets.com/b3d81270f55103cc770941952a359867d1a9757a57bc803ba477345002911581/matplotlib/matplotlib/issues/28990
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/b3d81270f55103cc770941952a359867d1a9757a57bc803ba477345002911581/matplotlib/matplotlib/issues/28990
og:image:altBug summary Possible bug or maybe a usage issue following some recent updates... In short, it used to be possible to set the hatch color for each filled contour area to a different color by iterati...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamekafitzgerald
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/28990#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F28990
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%2F28990
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/28990
Reloadhttps://github.com/matplotlib/matplotlib/issues/28990
Reloadhttps://github.com/matplotlib/matplotlib/issues/28990
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/28990
matplotlib https://github.com/matplotlib
matplotlibhttps://github.com/matplotlib/matplotlib
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/28990
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
#28993https://github.com/matplotlib/matplotlib/pull/28993
[Bug]: no longer able to set multiple hatch colorshttps://github.com/matplotlib/matplotlib/issues/28990#top
#28993https://github.com/matplotlib/matplotlib/pull/28993
status: confirmed bughttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22status%3A%20confirmed%20bug%22
v3.9.3https://github.com/matplotlib/matplotlib/milestone/95
https://github.com/kafitzgerald
kafitzgeraldhttps://github.com/kafitzgerald
on Oct 17, 2024https://github.com/matplotlib/matplotlib/issues/28990#issue-2595871298
https://private-user-images.githubusercontent.com/7872563/377649783-6c2306b5-196b-4488-b02d-2175df0f3238.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODM4MzU4MTEsIm5iZiI6MTc4MzgzNTUxMSwicGF0aCI6Ii83ODcyNTYzLzM3NzY0OTc4My02YzIzMDZiNS0xOTZiLTQ0ODgtYjAyZC0yMTc1ZGYwZjMyMzgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDcxMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjA3MTJUMDU1MTUxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MWRlODYyODBjNWE2MTIyNmI1ZDczYjQ4OWFmOGQ4YzBhZjkyMzNkYjk2YjRmMzAxZTMzYzk3YzQzZjE2MmE2NSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGcG5nIn0.0ovgZ2SUWg8jLAWpnehH8vnoiwn4NQ7Pu-gjEU82mXs
https://private-user-images.githubusercontent.com/7872563/377649801-705fc1c6-7e35-46c8-a815-5e3f57458b0a.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODM4MzU4MTEsIm5iZiI6MTc4MzgzNTUxMSwicGF0aCI6Ii83ODcyNTYzLzM3NzY0OTgwMS03MDVmYzFjNi03ZTM1LTQ2YzgtYTgxNS01ZTNmNTc0NThiMGEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDcxMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjA3MTJUMDU1MTUxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NmRlNzk0ODg3YzgzODQ4YTM1M2VmNjkyYzI3NjQ3ZmIyNzZjYjI4NzE0NjUyNTlmMDY3MmMxZDYxYzU4MTc0NyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGcG5nIn0.dYuXLoRgjYQ6gxbcqRU7ywyS3Ih7qw-_PD4etl35M00
status: confirmed bughttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22status%3A%20confirmed%20bug%22
v3.9.3https://github.com/matplotlib/matplotlib/milestone/95
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.