Title: Change the size of legend markers... · Issue #12417 · matplotlib/matplotlib · GitHub
Open Graph Title: Change the size of legend markers... · Issue #12417 · matplotlib/matplotlib
X Title: Change the size of legend markers... · Issue #12417 · matplotlib/matplotlib
Description: Closed a PR that did this, which was probably over engineered. But the main idea is probably still useful. #11127 is a bit different, it would create many legend entries for a single scatterplot. The idea here was to unify the size of di...
Open Graph Description: Closed a PR that did this, which was probably over engineered. But the main idea is probably still useful. #11127 is a bit different, it would create many legend entries for a single scatterplot. T...
X Description: Closed a PR that did this, which was probably over engineered. But the main idea is probably still useful. #11127 is a bit different, it would create many legend entries for a single scatterplot. T...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/12417
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Change the size of legend markers...","articleBody":"Closed a PR that did this, which was probably over engineered. But the main idea is probably still useful.\r\n\r\n#11127 is a bit different, it would create many legend entries for a single scatterplot. The idea here was to unify the size of different scatter plot's handles. Many options are shown in [the stackoverflow question \"setting a fixed size for points in legend\"](https://stackoverflow.com/questions/24706125/setting-a-fixed-size-for-points-in-legend). The easiest is just:\r\n\r\n```\r\nlegend = plt.legend()\r\nfor legobj in legend.legendHandles:\r\n legobj.set_sizes([64])\r\n```\r\n\r\nMy faviourite, which I just added to that thread as well would be to use the update function of the Handler.\r\n\r\n```\r\ndef update(handle, orig):\r\n handle.update_from(orig)\r\n handle.set_sizes([64])\r\n\r\nplt.legend(handler_map={PathCollection : HandlerPathCollection(update_func=update)})\r\n```\r\n\r\n_Originally posted by @ImportanceOfBeingErnest in https://github.com/matplotlib/matplotlib/pull/4257#issuecomment-427536275_","author":{"url":"https://github.com/jklymak","@type":"Person","name":"jklymak"},"datePublished":"2018-10-06T02:01:54.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/12417/matplotlib/issues/12417"}
| 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:05e53cc7-3671-4176-1cf2-378be92883c1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B55C:17A244:102583D:15D8893:6A5335A1 |
| html-safe-nonce | 25bb2cfa259ead995fe6abaf60076300583263c99a72bb0b00e8f22ae8843284 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNTVDOjE3QTI0NDoxMDI1ODNEOjE1RDg4OTM6NkE1MzM1QTEiLCJ2aXNpdG9yX2lkIjoiNjQ2MzU1NDY2MjcyOTcyNTM0NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 086612de2dcebebd679254a5c3d3c4d9c3399d32e122e28a52ba18341bc0d5a1 |
| hovercard-subject-tag | issue:367413855 |
| 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/12417/issue_layout |
| twitter:image | https://opengraph.githubassets.com/54dabaf606761741dfe77a4be7ca7e43c024ec654a500a1efb04f4f25ee8d671/matplotlib/matplotlib/issues/12417 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/54dabaf606761741dfe77a4be7ca7e43c024ec654a500a1efb04f4f25ee8d671/matplotlib/matplotlib/issues/12417 |
| og:image:alt | Closed a PR that did this, which was probably over engineered. But the main idea is probably still useful. #11127 is a bit different, it would create many legend entries for a single scatterplot. T... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jklymak |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| 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 | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width