Title: nbagg broken on master. 'Path' is not defined... · Issue #11426 · matplotlib/matplotlib · GitHub
Open Graph Title: nbagg broken on master. 'Path' is not defined... · Issue #11426 · matplotlib/matplotlib
X Title: nbagg broken on master. 'Path' is not defined... · Issue #11426 · matplotlib/matplotlib
Description: Bug report On master, in a jupyter notebook: import numpy as np import matplotlib.pyplot as plt %matplotlib notebook fig, ax = plt.subplots() ax.plot(range(10)) Gives: ---------------------------------------------------------------------...
Open Graph Description: Bug report On master, in a jupyter notebook: import numpy as np import matplotlib.pyplot as plt %matplotlib notebook fig, ax = plt.subplots() ax.plot(range(10)) Gives: -----------------------------...
X Description: Bug report On master, in a jupyter notebook: import numpy as np import matplotlib.pyplot as plt %matplotlib notebook fig, ax = plt.subplots() ax.plot(range(10)) Gives: -----------------------------...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/11426
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"nbagg broken on master. 'Path' is not defined...","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\nOn master, in a jupyter notebook:\r\n\r\n```\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n%matplotlib notebook\r\n\r\nfig, ax = plt.subplots()\r\nax.plot(range(10))\r\n```\r\n\r\nGives:\r\n\r\n```\r\n---------------------------------------------------------------------------\r\nNameError Traceback (most recent call last)\r\n\u003cipython-input-2-545a291cf584\u003e in \u003cmodule\u003e()\r\n----\u003e 1 fig, ax = plt.subplots()\r\n 2 ax.plot(range(10))\r\n\r\n~/matplotlib/lib/matplotlib/pyplot.py in subplots(nrows, ncols, sharex, sharey, squeeze, subplot_kw, gridspec_kw, **fig_kw)\r\n 1113 :meth:`.Figure.subplots`\r\n 1114 \"\"\"\r\n-\u003e 1115 fig = figure(**fig_kw)\r\n 1116 axs = fig.subplots(nrows=nrows, ncols=ncols, sharex=sharex, sharey=sharey,\r\n 1117 squeeze=squeeze, subplot_kw=subplot_kw,\r\n\r\n~/matplotlib/lib/matplotlib/pyplot.py in figure(num, figsize, dpi, facecolor, edgecolor, frameon, FigureClass, clear, **kwargs)\r\n 519 frameon=frameon,\r\n 520 FigureClass=FigureClass,\r\n--\u003e 521 **kwargs)\r\n 522 \r\n 523 if figLabel:\r\n\r\n~/matplotlib/lib/matplotlib/backend_bases.py in new_figure_manager(cls, num, *args, **kwargs)\r\n 3251 fig_cls = kwargs.pop('FigureClass', Figure)\r\n 3252 fig = fig_cls(*args, **kwargs)\r\n-\u003e 3253 return cls.new_figure_manager_given_figure(num, fig)\r\n 3254 \r\n 3255 @classmethod\r\n\r\n~/matplotlib/lib/matplotlib/backends/backend_nbagg.py in new_figure_manager_given_figure(num, figure)\r\n 230 manager = FigureManagerNbAgg(canvas, num)\r\n 231 if is_interactive():\r\n--\u003e 232 manager.show()\r\n 233 figure.canvas.draw_idle()\r\n 234 canvas.mpl_connect('close_event', lambda event: Gcf.destroy(num))\r\n\r\n~/matplotlib/lib/matplotlib/backends/backend_nbagg.py in show(self)\r\n 87 def show(self):\r\n 88 if not self._shown:\r\n---\u003e 89 self.display_js()\r\n 90 self._create_comm()\r\n 91 else:\r\n\r\n~/matplotlib/lib/matplotlib/backends/backend_nbagg.py in display_js(self)\r\n 83 # browser instances using the same kernel (require.js - but the\r\n 84 # file isn't static?).\r\n---\u003e 85 display(Javascript(FigureManagerNbAgg.get_javascript()))\r\n 86 \r\n 87 def show(self):\r\n\r\n~/matplotlib/lib/matplotlib/backends/backend_nbagg.py in get_javascript(cls, stream)\r\n 112 output = stream\r\n 113 super().get_javascript(stream=output)\r\n--\u003e 114 output.write((Path(__file__).parent / \"web_backend/js/nbagg_mpl.js\")\r\n 115 .read_text(encoding=\"utf-8\"))\r\n 116 if stream is None:\r\n\r\nNameError: name 'Path' is not defined\r\n```\r\n\r\n**Bug summary**\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\n# Paste your code here\r\n#\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# If applicable, paste the console output here\r\n#\r\n#\r\n```\r\n\r\n**Expected outcome**\r\n\r\n\u003c!--A description of the expected outcome from the code snippet--\u003e\r\n\u003c!--If this used to work in an earlier version of Matplotlib, please note the version it used to work on--\u003e\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:\r\n * Matplotlib version: \r\n * Matplotlib backend (`print(matplotlib.get_backend())`):\r\n * Python version:\r\n * Jupyter version (if applicable):\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\n","author":{"url":"https://github.com/jklymak","@type":"Person","name":"jklymak"},"datePublished":"2018-06-12T19:38:40.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/11426/matplotlib/issues/11426"}
| 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:c0164236-ccfb-95fa-b5c3-fccd45daf9e7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D290:C7E79:25268A8:35F6CF0:6A565C11 |
| html-safe-nonce | 397bd9d96771f75ab19e29a7a39de1797262e8cdd5de78db2b167dc99e84c414 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjkwOkM3RTc5OjI1MjY4QTg6MzVGNkNGMDo2QTU2NUMxMSIsInZpc2l0b3JfaWQiOiI0MTgyMjE3NDA5NzYyMzE5Mzc3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | fd7fdd1369c3c96c84f95dd30b787a36a12890807932bda23b67c178cff2ae89 |
| hovercard-subject-tag | issue:331725189 |
| 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/11426/issue_layout |
| twitter:image | https://opengraph.githubassets.com/61df262ceed1b1d3df39cc1d577a46a86284022d76750d02bb8e19671b368f88/matplotlib/matplotlib/issues/11426 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/61df262ceed1b1d3df39cc1d577a46a86284022d76750d02bb8e19671b368f88/matplotlib/matplotlib/issues/11426 |
| og:image:alt | Bug report On master, in a jupyter notebook: import numpy as np import matplotlib.pyplot as plt %matplotlib notebook fig, ax = plt.subplots() ax.plot(range(10)) Gives: -----------------------------... |
| 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 | 6a3afe34dff341ad10912db44becf282289d7f2af20576241738530fbb28de01 |
| 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 | b71002134df95575e9f6c2945a64d454b0be181e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width