Title: Legends cut off in Jupyter Notebooks when plotting with %matplotlib notebook command · Issue #9163 · matplotlib/matplotlib · GitHub
Open Graph Title: Legends cut off in Jupyter Notebooks when plotting with %matplotlib notebook command · Issue #9163 · matplotlib/matplotlib
X Title: Legends cut off in Jupyter Notebooks when plotting with %matplotlib notebook command · Issue #9163 · matplotlib/matplotlib
Description: Bug report When using matplotlib in a Jupyter Notebook with the magic %matplotlib notebook, legends placed outside of the axis are cut off. Code for reproduction import matplotlib.pyplot as plt # probably unnecessary/overkill, but reset ...
Open Graph Description: Bug report When using matplotlib in a Jupyter Notebook with the magic %matplotlib notebook, legends placed outside of the axis are cut off. Code for reproduction import matplotlib.pyplot as plt # p...
X Description: Bug report When using matplotlib in a Jupyter Notebook with the magic %matplotlib notebook, legends placed outside of the axis are cut off. Code for reproduction import matplotlib.pyplot as plt # p...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/9163
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Legends cut off in Jupyter Notebooks when plotting with %matplotlib notebook command","articleBody":"\u003c!--To help us understand and resolve your issue, please fill out the form to the best of your ability.--\u003e\r\n\u003c!--You can feel free to delete the sections that do not apply.--\u003e\r\n\r\n### Bug report\r\n\r\nWhen using matplotlib in a Jupyter Notebook with the magic `%matplotlib notebook`, legends placed outside of the axis are cut off. \r\n\r\n\u003c!--A short 1-2 sentences that succinctly describes the bug--\u003e\r\n\r\n**Code for reproduction**\r\n\r\n\u003c!--A minimum code snippet required to reproduce the bug, also minimizing the number of dependencies required--\u003e\r\n\r\n```python\r\nimport matplotlib.pyplot as plt\r\n# probably unnecessary/overkill, but reset all parameters to default\r\nplt.rcParams.update(plt.rcParamsDefault)\r\n%matplotlib notebook\r\n\r\nfig, ax = plt.subplots(ncols=1, nrows=1)\r\nax.plot(range(10), label=\"Plot 1\")\r\nax.plot(range(10, 0, -1), label=\"Plot 2\")\r\nax.legend(loc='center right', bbox_to_anchor=(1.20, 0.5))\r\n\r\n```\r\n\r\n**Actual outcome**\r\n\r\n\u003c!--The output produced by the above code, which may be a screenshot, console output, etc.--\u003e\r\n\r\n\r\n\r\n\r\n\r\n\r\n**Expected outcome**\r\n\r\nThe legend would be fully displayed as in the following example. This plot obtained by switching to `%matplotlib inline`\r\n\r\n \r\n\r\n**Matplotlib version**\r\n\u003c!--Please specify your platform and versions of the relevant libraries you are using:--\u003e\r\n * Operating System: Windows 7, x64\r\n * Matplotlib Version: 2.0.2\r\n * Python Version: 3.6.2\r\n * Jupyter Server: 5.0.0\r\n * Other Libraries: \r\n\r\n\u003c!--Please tell us how you installed matplotlib and python e.g., from source, pip, conda--\u003e\r\n\u003c!--If you installed from conda, please specify which channel you used if not the default--\u003e\r\nMatplotlib and python were installed using Anaconda\r\n\r\n**Additional Information**\r\nThis seems similar to #2530 ","author":{"url":"https://github.com/mtd91429","@type":"Person","name":"mtd91429"},"datePublished":"2017-09-06T22:55:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/9163/matplotlib/issues/9163"}
| 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:d2d18a82-9f2b-7d58-8cc7-18c5e29ce8d1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9DCC:1CCBDE:7FD033:AB66A6:6A530877 |
| html-safe-nonce | d48d50c62770e367ed352c42f67f8d6b4379ba712a2d2db6da7772688747edac |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RENDOjFDQ0JERTo3RkQwMzM6QUI2NkE2OjZBNTMwODc3IiwidmlzaXRvcl9pZCI6IjY1OTAyODQ3MjQwMDkwNjM1OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f5d7da92b90fbfc0451f899bc0365026338977d3030f683bf8ac5690d6940c70 |
| hovercard-subject-tag | issue:255766137 |
| 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/9163/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c0a6d6b4bb37841c2631586e264c26e5df0ac04d39c5e487d2d285d486d00d2d/matplotlib/matplotlib/issues/9163 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c0a6d6b4bb37841c2631586e264c26e5df0ac04d39c5e487d2d285d486d00d2d/matplotlib/matplotlib/issues/9163 |
| og:image:alt | Bug report When using matplotlib in a Jupyter Notebook with the magic %matplotlib notebook, legends placed outside of the axis are cut off. Code for reproduction import matplotlib.pyplot as plt # p... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mtd91429 |
| 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