Title: Legend does not show 'annotate' · Issue #8236 · matplotlib/matplotlib · GitHub
Open Graph Title: Legend does not show 'annotate' · Issue #8236 · matplotlib/matplotlib
X Title: Legend does not show 'annotate' · Issue #8236 · matplotlib/matplotlib
Description: When using annotate to draw an arrow, it does not show up in the legend. Example code: import matplotlib.pylab as plt %matplotlib inline fig, ax = plt.subplots(1) ax.plot([0, 1], [0, 0], label='line1') ax.plot([0, 1], [1, 1], label='line...
Open Graph Description: When using annotate to draw an arrow, it does not show up in the legend. Example code: import matplotlib.pylab as plt %matplotlib inline fig, ax = plt.subplots(1) ax.plot([0, 1], [0, 0], label='lin...
X Description: When using annotate to draw an arrow, it does not show up in the legend. Example code: import matplotlib.pylab as plt %matplotlib inline fig, ax = plt.subplots(1) ax.plot([0, 1], [0, 0], label='...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/8236
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Legend does not show 'annotate'","articleBody":"When using `annotate` to draw an arrow, it does not show up in the legend.\r\n\r\nExample code:\r\n```python\r\nimport matplotlib.pylab as plt\r\n%matplotlib inline\r\n\r\nfig, ax = plt.subplots(1)\r\nax.plot([0, 1], [0, 0], label='line1')\r\nax.plot([0, 1], [1, 1], label='line2')\r\nax.annotate(\"\",\r\n xy=(0.4,1.0),\r\n xytext=(0.4,0.0),\r\n arrowprops={'arrowstyle':'\u003c-\u003e', 'color':'C7' },\r\n label='distance')\r\nax.legend()\r\n```\r\ngives:\r\n\r\n\r\nI would expect an entry \"distance\" in the legend, with a grey double-sided arrow as symbol.\r\n\r\n(I use Python 3.6.0 and Matplotlib 2.0.0 from Archlinux repository)","author":{"url":"https://github.com/jlecoeur","@type":"Person","name":"jlecoeur"},"datePublished":"2017-03-08T13:19:47.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/8236/matplotlib/issues/8236"}
| 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:5143f48e-7ed7-0111-784c-ed442d9ba564 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 929C:1EECE0:B45C45:F2DB21:6A51EF6A |
| html-safe-nonce | 622140fe598b0a814624bea76f1feda358da5248ff20c4d75a60370515760303 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MjlDOjFFRUNFMDpCNDVDNDU6RjJEQjIxOjZBNTFFRjZBIiwidmlzaXRvcl9pZCI6IjQyMzEwNTAxMzU2NTA1NjE4OTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4ed430f8f128b01b24fcd46b9c205c91a34c7fb6a6a3840c292300ce80c47515 |
| hovercard-subject-tag | issue:212731938 |
| 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/8236/issue_layout |
| twitter:image | https://opengraph.githubassets.com/83db6e645edb718b543d9fb898021b12be38b57361875da181c207cb6bd98e4b/matplotlib/matplotlib/issues/8236 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/83db6e645edb718b543d9fb898021b12be38b57361875da181c207cb6bd98e4b/matplotlib/matplotlib/issues/8236 |
| og:image:alt | When using annotate to draw an arrow, it does not show up in the legend. Example code: import matplotlib.pylab as plt %matplotlib inline fig, ax = plt.subplots(1) ax.plot([0, 1], [0, 0], label='lin... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jlecoeur |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width