Title: nbagg backend incredibly laggy in IPython notebook · Issue #6850 · matplotlib/matplotlib · GitHub
Open Graph Title: nbagg backend incredibly laggy in IPython notebook · Issue #6850 · matplotlib/matplotlib
X Title: nbagg backend incredibly laggy in IPython notebook · Issue #6850 · matplotlib/matplotlib
Description: Matplotlib version, Python version and Platform (Windows, OSX, Linux ...) Windows 10, Matplotlib 1.5.1, Python 3.5.2 I wrote some code for allowing the user to draw rectangles in a blank matplotlib graph using the nbagg backend in an IPy...
Open Graph Description: Matplotlib version, Python version and Platform (Windows, OSX, Linux ...) Windows 10, Matplotlib 1.5.1, Python 3.5.2 I wrote some code for allowing the user to draw rectangles in a blank matplotlib...
X Description: Matplotlib version, Python version and Platform (Windows, OSX, Linux ...) Windows 10, Matplotlib 1.5.1, Python 3.5.2 I wrote some code for allowing the user to draw rectangles in a blank matplotlib...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/6850
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"nbagg backend incredibly laggy in IPython notebook","articleBody":"- [ ] Matplotlib version, Python version and Platform (Windows, OSX, Linux ...)\n Windows 10, Matplotlib 1.5.1, Python 3.5.2\n\nI wrote some code for allowing the user to draw rectangles in a blank matplotlib graph using the nbagg backend in an IPython notebook, and it is incredibly laggy. Is this a current limitation, or is this perhaps a bug with the library? Here is the code I have:\n\n```\nimport matplotlib\nmatplotlib.use(\"nbagg\")\nimport matplotlib.pyplot as plt\nfrom matplotlib.patches import Rectangle\nfrom ipywidgets.widgets import Button\nfrom IPython.display import display\n\nclass Test(object):\n def __init__(self):\n plt.ion()\n self.figure = plt.figure()\n self.ax = self.figure.gca()\n self.rect = Rectangle((0,0), 0, 0, color = '0', fill = False)\n self.x0 = None\n self.y0 = None\n self.x1 = None\n self.y1 = None\n # Graph interaction\n self.ax.add_patch(self.rect)\n self.ax.figure.canvas.mpl_connect('button_press_event', self.on_press)\n self.ax.figure.canvas.mpl_connect('button_release_event', self.on_release)\n self.ax.figure.canvas.mpl_connect('motion_notify_event', self.on_motion)\n\n def on_motion(self, event):\n if self.is_pressed:\n self.x1 = event.xdata\n self.y1 = event.ydata\n\n self.rect.set_width(self.x1 - self.x0)\n self.rect.set_height(self.y1 - self.y0)\n self.rect.set_xy((self.x0, self.y0))\n self.rect.figure.canvas.draw()\n\n def on_press(self, event):\n self.is_pressed = 1\n self.x0 = event.xdata\n self.y0 = event.ydata\n self.rect.set_visible(True)\n\n def on_release(self, event):\n self.is_pressed = 0\n self.ax.scatter(self.x_inside, self.y_inside, c = \"red\")\n self.figure.canvas.draw()\n self.rect.set_visible(False)\n self.rect.figure.canvas.draw()\n\n\ntest = Test()\n```\n","author":{"url":"https://github.com/alexanderwhatley","@type":"Person","name":"alexanderwhatley"},"datePublished":"2016-07-28T05:45:03.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/6850/matplotlib/issues/6850"}
| 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:c42d3d7a-96e2-6230-55be-c04d75dd61b1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 89DE:17CF54:200A3F:2D1AAA:6A536C13 |
| html-safe-nonce | 8a1826abc7ee6eaba5f0c4ed1276822e0816c1f0d616d41667bb30442cd7bb85 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OURFOjE3Q0Y1NDoyMDBBM0Y6MkQxQUFBOjZBNTM2QzEzIiwidmlzaXRvcl9pZCI6IjU1MTQyMjU1MjE0NjUxOTE0NDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | bf065739e990661ebabeefa4a2cbbc334e45ba2fa2c4c59e94fe8605ee498ffc |
| hovercard-subject-tag | issue:168017181 |
| 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/6850/issue_layout |
| twitter:image | https://opengraph.githubassets.com/07dc73879aa08ecf76cdc25a0ac315dfad02fd78acaff78e2c3deba487544c4d/matplotlib/matplotlib/issues/6850 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/07dc73879aa08ecf76cdc25a0ac315dfad02fd78acaff78e2c3deba487544c4d/matplotlib/matplotlib/issues/6850 |
| og:image:alt | Matplotlib version, Python version and Platform (Windows, OSX, Linux ...) Windows 10, Matplotlib 1.5.1, Python 3.5.2 I wrote some code for allowing the user to draw rectangles in a blank matplotlib... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | alexanderwhatley |
| 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