Title: Labels for PatchCollection do not show · Issue #23998 · matplotlib/matplotlib · GitHub
Open Graph Title: Labels for PatchCollection do not show · Issue #23998 · matplotlib/matplotlib
X Title: Labels for PatchCollection do not show · Issue #23998 · matplotlib/matplotlib
Description: Bug summary Labels / legend is not displayed Autoscale does nothing, I have to manually set the limits Code for reproduction import matplotlib.pyplot as plt from matplotlib.collections import PatchCollection from matplotlib.patches impor...
Open Graph Description: Bug summary Labels / legend is not displayed Autoscale does nothing, I have to manually set the limits Code for reproduction import matplotlib.pyplot as plt from matplotlib.collections import Patch...
X Description: Bug summary Labels / legend is not displayed Autoscale does nothing, I have to manually set the limits Code for reproduction import matplotlib.pyplot as plt from matplotlib.collections import Patch...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/23998
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Labels for PatchCollection do not show","articleBody":"### Bug summary\n\n1. Labels / legend is not displayed\r\n2. Autoscale does nothing, I have to manually set the limits\r\n\r\n\r\n\n\n### Code for reproduction\n\n```python\nimport matplotlib.pyplot as plt\r\nfrom matplotlib.collections import PatchCollection\r\nfrom matplotlib.patches import Polygon\r\n\r\nfig, axs = plt.subplots()\r\np1, p2 = Polygon([[0,0],[100,100],[200,0]], label=\"p1\"), Polygon([[400,0],[500,100],[600,0]], label=\"p2\")\r\np = PatchCollection([p1,p2], label=\"asd\")\r\naxs.add_collection(p, autolim=True)\r\naxs.set_xlim(right=600)\r\naxs.set_ylim(top=100)\r\naxs.legend()\n```\n\n\n### Actual outcome\n\nNo labels/legend are shown - \n\n### Expected outcome\n\nLegend is shown\n\n### Additional information\n\n_No response_\n\n### Operating system\n\n_No response_\n\n### Matplotlib Version\n\n3.5.2\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\n_No response_","author":{"url":"https://github.com/Robotatron","@type":"Person","name":"Robotatron"},"datePublished":"2022-09-24T21:59:10.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":12},"url":"https://github.com/23998/matplotlib/issues/23998"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4586274e-b824-892f-534d-2382eb0a1231 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D886:3E67A5:DC7808:1338C12:6A4E87F4 |
| html-safe-nonce | 14903fb0900949ff4b9ad39d38f3d68c2ab6649a17d0842e4b062d288a59e80c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEODg2OjNFNjdBNTpEQzc4MDg6MTMzOEMxMjo2QTRFODdGNCIsInZpc2l0b3JfaWQiOiI2MDI1NDU4Mjc5MDI2NDI3ODkyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 0d0adc1531d65411982cd32fced96edd1112a44d074fb3f3c24d73cf8f49942e |
| hovercard-subject-tag | issue:1384823697 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/23998/issue_layout |
| twitter:image | https://opengraph.githubassets.com/334717a2c2ec991a9f4660154558ccac247eed917862a1c9d30d8e1bfe630d34/matplotlib/matplotlib/issues/23998 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/334717a2c2ec991a9f4660154558ccac247eed917862a1c9d30d8e1bfe630d34/matplotlib/matplotlib/issues/23998 |
| og:image:alt | Bug summary Labels / legend is not displayed Autoscale does nothing, I have to manually set the limits Code for reproduction import matplotlib.pyplot as plt from matplotlib.collections import Patch... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Robotatron |
| hostname | github.com |
| expected-hostname | github.com |
| None | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width