Title: Broken legend auto-position with step*-type histograms · Issue #9580 · matplotlib/matplotlib · GitHub
Open Graph Title: Broken legend auto-position with step*-type histograms · Issue #9580 · matplotlib/matplotlib
X Title: Broken legend auto-position with step*-type histograms · Issue #9580 · matplotlib/matplotlib
Description: Bug report Bug summary Automatic placing of legend seems to be not working with histograms of type step*. If I am correct, this is a new entry in the long list of current issues with legend ^^. Code for reproduction import matplotlib.pyp...
Open Graph Description: Bug report Bug summary Automatic placing of legend seems to be not working with histograms of type step*. If I am correct, this is a new entry in the long list of current issues with legend ^^. Cod...
X Description: Bug report Bug summary Automatic placing of legend seems to be not working with histograms of type step*. If I am correct, this is a new entry in the long list of current issues with legend ^^. Cod...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/9580
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Broken legend auto-position with step*-type histograms","articleBody":"### Bug report\r\n\r\n**Bug summary**\r\n\r\nAutomatic placing of legend seems to be not working with histograms of type `step*`. If I am correct, this is a new entry in the long list of current issues with legend ^^.\r\n\r\n**Code for reproduction**\r\n\r\n```python\r\nimport matplotlib.pyplot as plt\r\n\r\nhist_types = ('bar', 'barstacked', 'step', 'stepfilled')\r\n\r\nfig, axs = plt.subplots(nrows=len(hist_types), num=\"test\") \r\nfor ax, ht in zip(axs.flat, hist_types):\r\n ax.set_title(ht)\r\n ax.hist([0] + 5*[9], bins=range(10), label=f\"This is a label\", histtype=ht) \r\n ax.legend(loc=\"best\")\r\n\r\nfig.tight_layout()\r\n#fig.savefig(fig.get_label() + \".png\")\r\n```\r\n\r\n**Actual outcome**\r\n\r\nMatplotlib 2.1\r\n\r\n\r\n\r\n**Expected outcome**\r\n\r\nThe same auto-position of the legend on each subplot, i.e. *upper left*, whatever is the histogram style.\r\n\r\n**Matplotlib version**\r\n\r\n * Operating system: GNU/Linux (Fedora 26)\r\n * Matplotlib version: 2.1 from conda (also test “successfully” with master)\r\n * Matplotlib backend (`print(matplotlib.get_backend())`): Qt5Agg\r\n * Python version: 3.6.3 from conda\r\n * Jupyter version (if applicable): X\r\n * Other libraries: X\r\n\r\n*FWIW, I tried the above snippet on Matplotlib 1.5.0 and the result is similar.*\r\n\r\n**Edit:** tweaked a bit the snippet to be Matplotlib v1.5.x-compliant.\r\n","author":{"url":"https://github.com/afvincent","@type":"Person","name":"afvincent"},"datePublished":"2017-10-25T23:23:55.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":20},"url":"https://github.com/9580/matplotlib/issues/9580"}
| 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:c1fe2742-7974-3efe-9c5c-231e48548dd5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E64A:3614ED:138A278:19C5B53:6A51B376 |
| html-safe-nonce | 5e46429254237a75035ddd4618ae1ee76b160a773bb189536cab96f58c11bb14 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNjRBOjM2MTRFRDoxMzhBMjc4OjE5QzVCNTM6NkE1MUIzNzYiLCJ2aXNpdG9yX2lkIjoiMTM2NTc2OTA3MzI4NDE5OTI4NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 23a036338ca4eeef6752f106e40c02a25c54ad390b11b411bb69efcc3e30aed8 |
| hovercard-subject-tag | issue:268582037 |
| 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/9580/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5599f4cb51dc544000be5e5757da2c1817c6d1249a1fb0f6d60a41e23feca0b8/matplotlib/matplotlib/issues/9580 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5599f4cb51dc544000be5e5757da2c1817c6d1249a1fb0f6d60a41e23feca0b8/matplotlib/matplotlib/issues/9580 |
| og:image:alt | Bug report Bug summary Automatic placing of legend seems to be not working with histograms of type step*. If I am correct, this is a new entry in the long list of current issues with legend ^^. Cod... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | afvincent |
| 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