Title: Default legend location 'best' is extremely slow · Issue #8108 · matplotlib/matplotlib · GitHub
Open Graph Title: Default legend location 'best' is extremely slow · Issue #8108 · matplotlib/matplotlib
X Title: Default legend location 'best' is extremely slow · Issue #8108 · matplotlib/matplotlib
Description: Matplotlib 2.0.0 seems to have changed the default legend location from "upper right" to "best" (although the documentation doesn't say this). I have noticed that this results in a severe performance penalty: several plots which would no...
Open Graph Description: Matplotlib 2.0.0 seems to have changed the default legend location from "upper right" to "best" (although the documentation doesn't say this). I have noticed that this results in a severe performan...
X Description: Matplotlib 2.0.0 seems to have changed the default legend location from "upper right" to "best" (although the documentation doesn't say this). I have noticed that this resul...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/8108
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Default legend location 'best' is extremely slow","articleBody":"Matplotlib 2.0.0 seems to have changed the default legend location from \"upper right\" to \"best\" (although the documentation doesn't say this). I have noticed that this results in a severe performance penalty: several plots which would normally render in a fraction of a second now need 5-10 seconds. To make things worse, the legend location is recalculated whenever the plot is moved or zoomed. The sharex/sharey functionality which I use quite a lot makes this even slower, since all subplots are moved or zoomed simultaneously.\r\n\r\n**Code for reproduction**\r\n\r\n```python\r\nfrom pylab import *\r\n\r\nx = linspace(0, 100, 100000)\r\n\r\nclose(\"all\")\r\nfigure(\"Test\", figsize=(12, 8))\r\nfor j in range(9):\r\n\tif j == 0:\r\n\t\tax = subplot(3, 3, 1)\r\n\telse:\r\n\t\tsubplot(3, 3, j + 1, sharex=ax, sharey=ax)\r\n\tfor i in range(8):\r\n\t\tplot(x, sin(x + i * 0.5), color=cm.magma(i/8), label=\"test\")\r\n\tlegend(fontsize=\"small\")\r\n\r\ntight_layout()\r\nshow()\r\n```\r\n\r\n**Matplotlib version**\r\n\r\n- Matplotlib 2.0.0 (installed with pip)\r\n- Python 3.6.0 (compiled from source)\r\n- Platform: Linux (CentOS 6)","author":{"url":"https://github.com/MaartenBaert","@type":"Person","name":"MaartenBaert"},"datePublished":"2017-02-20T18:12:03.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":18},"url":"https://github.com/8108/matplotlib/issues/8108"}
| 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:c10b0ea7-4857-c78a-19e8-613238016323 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D790:3161F8:1A06BCF:22BFEFF:6A544A3F |
| html-safe-nonce | c315196d9348a591dca89a74d868c0a7c5421a3687ba4f15e05b6833b56170be |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENzkwOjMxNjFGODoxQTA2QkNGOjIyQkZFRkY6NkE1NDRBM0YiLCJ2aXNpdG9yX2lkIjoiNzU4NTc3ODY1MzA5MjY2MTgyNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 50fadef200bba3ae412297c3ca92188a1a202df9e43b467e580fb0698e4d26ae |
| hovercard-subject-tag | issue:208951383 |
| 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/8108/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f2df8ec49f14949b3501c819ca70ef705b195ba713d92acfae2403b2d2ca81dd/matplotlib/matplotlib/issues/8108 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f2df8ec49f14949b3501c819ca70ef705b195ba713d92acfae2403b2d2ca81dd/matplotlib/matplotlib/issues/8108 |
| og:image:alt | Matplotlib 2.0.0 seems to have changed the default legend location from "upper right" to "best" (although the documentation doesn't say this). I have noticed that this results in a severe performan... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | MaartenBaert |
| 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