Title: The plot function of the matplotlib 2 and 3 versions is much slower than 1.5.3 · Issue #12542 · matplotlib/matplotlib · GitHub
Open Graph Title: The plot function of the matplotlib 2 and 3 versions is much slower than 1.5.3 · Issue #12542 · matplotlib/matplotlib
X Title: The plot function of the matplotlib 2 and 3 versions is much slower than 1.5.3 · Issue #12542 · matplotlib/matplotlib
Description: Bug report Bug summary The plot function of the matplotlib 2 and 3 versions is much slower than the plot function of matplotlib 1.5.3 if one plots many lines (and other objects) in an Axes. Code for reproduction I have tested it on an Ub...
Open Graph Description: Bug report Bug summary The plot function of the matplotlib 2 and 3 versions is much slower than the plot function of matplotlib 1.5.3 if one plots many lines (and other objects) in an Axes. Code fo...
X Description: Bug report Bug summary The plot function of the matplotlib 2 and 3 versions is much slower than the plot function of matplotlib 1.5.3 if one plots many lines (and other objects) in an Axes. Code fo...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/12542
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"The plot function of the matplotlib 2 and 3 versions is much slower than 1.5.3","articleBody":"### Bug report\r\n\r\n**Bug summary**\r\n\r\nThe plot function of the matplotlib 2 and 3 versions is much slower than the plot function of matplotlib 1.5.3 if one plots many lines (and other objects) in an Axes.\r\n\r\n**Code for reproduction**\r\n\r\nI have tested it on an Ubuntu server (CLI only), version 16.04 with python 3.5.2 (through virtualenv), matplotlib 1.5.3 with backend agg set by matplotlibrc. \r\n\r\n```python\r\nsetup=\"\"\"import matplotlib.pyplot as plt\r\na=[1,2]\"\"\"\r\ntest=\"plt.plot(a,a,'-')\"\r\nimport timeit\r\ntimeit.timeit(test,setup,number=1000)\r\n# output: 0.6324263589922339\r\ntimeit.timeit(test,setup,number=1000)\r\n# output: 0.6100882450118661\r\ntimeit.timeit(test,setup,number=1000)\r\n# output: 0.6113728249911219\r\n```\r\n=\u003e around 0.6-0.7 sec, it is stable for a few dozen times.\r\n\r\nOn the same machine \u0026 operating system, python 3.5.2 (through virtualenv), matplotlib 2.2.2 with backend agg. \r\n\r\n```python\r\nsetup=\"\"\"import matplotlib.pyplot as plt\r\na=[1,2]\"\"\"\r\ntest=\"plt.plot(a,a,'-')\"\r\nimport timeit\r\ntimeit.timeit(test,setup,number=1000)\r\n# output: 0.9981246230890974\r\ntimeit.timeit(test,setup,number=1000)\r\n# output: 1.3041282850317657\r\ntimeit.timeit(test,setup,number=1000)\r\n# output: 1.6257964670658112\r\ntimeit.timeit(test,setup,number=1000)\r\n# output: 1.9830634299432859\r\n```\r\n=\u003e getting slower and slower...\r\n\r\nNote that matplotlib 2.0.0, 2.0.1, 2.1.0, 2.1.2, 2.2.2, or 3.0.0 has the same slowdown behavior. If I set svg as backend, the result is the same as agg (I confirmed backend=\"svg\" only for matplotlib 2.0.0 on the Ubuntu server). \r\n\r\nThis behavior is also confirmed on a Windows distribution: WinPython-64bit-3.4.4.6Qt5 with matplotlib 2.0.0 and default backend TkAgg, but not for WinPython-64bit-3.4.4.5Qt5 with matplotlib version 1.5.3 and TkAgg, though the situation is much more complex. In addition, WinPython-64bit-3.5.1.1 and matplotlib 2.1.0 (packaged by Christoph Gohlke) causes the same slowdown behavior. \r\n\r\nAnother windows distribution anaconda 3 version 4.4.0(64bit) also has a similar behavior. For the anaconda 3 environment, all the packages are default of the 4.4.0 distribution (python 3.6 and matplotlib 2.0.2 with backend qt5agg), and it runs on windows7-x64. \r\n\r\nIf I close the figure by pyplot.close(), the slowed plot() is returned to the initial state. \r\n\r\n**Expected outcome**\r\n\r\nThe expected outcome is \"no slowdown for the plot function of matplotlib 3\" as the matplotlib version 1.5.3.\r\n\r\n**Matplotlib version**\r\n * Operating system: Ubuntu 1604 (CLI only)\r\n * Matplotlib version: matplotlib 2.2.2\r\n * Matplotlib backend (`print(matplotlib.get_backend())`): agg\r\n * Python version: 3.5.2\r\n * Jupyter version (if applicable): \r\n * Other libraries: \r\n\r\n**Other note**\r\n\r\nI have used a script to write huge maps with overlayed many lines drawn by plot(). When I'm with matplotlib 1.5.3, it takes several minutes to output a bunch of png files, but no fatal problem is there. However, with 2.0.0-3.0.0 it takes several hours or more, and I cannot use the script at all. \r\n\r\nI believe this slowdown behavior can occur for most of the matplotlib environments. I think this is not an OS/system dependent bug/specification. ","author":{"url":"https://github.com/materia9","@type":"Person","name":"materia9"},"datePublished":"2018-10-17T04:17:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":19},"url":"https://github.com/12542/matplotlib/issues/12542"}
| 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:10cbe87b-0934-2b78-f37b-0b2232287a79 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D5AA:2E411E:13A5717:1A6A259:6A53477E |
| html-safe-nonce | fb32eecb6bb1db1509c809e78b680e3b720c9f913250f9d4da6e8aaaecf599d0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENUFBOjJFNDExRToxM0E1NzE3OjFBNkEyNTk6NkE1MzQ3N0UiLCJ2aXNpdG9yX2lkIjoiNjg1MzExMTEwNDE2OTc4OTMxMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7c576952e713d46408222a06b986de3691eaf9d49419e23c787ff3226fd1b2b4 |
| hovercard-subject-tag | issue:370892598 |
| 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/12542/issue_layout |
| twitter:image | https://opengraph.githubassets.com/75cc93551c080efbf793207c42984b48bd5fce82c8d552b7777e0d12d9f0d623/matplotlib/matplotlib/issues/12542 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/75cc93551c080efbf793207c42984b48bd5fce82c8d552b7777e0d12d9f0d623/matplotlib/matplotlib/issues/12542 |
| og:image:alt | Bug report Bug summary The plot function of the matplotlib 2 and 3 versions is much slower than the plot function of matplotlib 1.5.3 if one plots many lines (and other objects) in an Axes. Code fo... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | materia9 |
| 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