Title: Looping gifs with PillowWriter · Issue #11787 · matplotlib/matplotlib · GitHub
Open Graph Title: Looping gifs with PillowWriter · Issue #11787 · matplotlib/matplotlib
X Title: Looping gifs with PillowWriter · Issue #11787 · matplotlib/matplotlib
Description: Bug report Bug summary Saving a gif using PillowWriter produces a gif that does not loop. Is there a way to make the gif loop endlessly using PillowWriter? Code for reproduction from matplotlib.animation import FuncAnimation, PillowWrite...
Open Graph Description: Bug report Bug summary Saving a gif using PillowWriter produces a gif that does not loop. Is there a way to make the gif loop endlessly using PillowWriter? Code for reproduction from matplotlib.ani...
X Description: Bug report Bug summary Saving a gif using PillowWriter produces a gif that does not loop. Is there a way to make the gif loop endlessly using PillowWriter? Code for reproduction from matplotlib.ani...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/11787
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Looping gifs with PillowWriter","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\n**Bug summary**\r\n\r\nSaving a gif using PillowWriter produces a gif that does not loop. Is there a way to make the gif loop endlessly using PillowWriter?\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\nfrom matplotlib.animation import FuncAnimation, PillowWriter\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\n\r\nx = np.linspace(0, 1, 20)\r\n\r\ndef f(x, i):\r\n return x*np.sin(i/10)\r\n\r\nline, = plt.plot(x, f(x, 0))\r\nplt.xlim([0,1])\r\nplt.ylim([-1,1])\r\nfig = plt.gcf()\r\ndef animate(i):\r\n line.set_data(x, f(x,i))\r\n\r\nanim = FuncAnimation(fig, animate, frames=60, interval=50)\r\nanim.save('fig.gif', writer=PillowWriter(fps=20))\r\nplt.show()\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**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\nSame gif, but I want it to loop once it finishes.\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 10 Version 1803\r\n * Matplotlib version: 2.2.2\r\n * Matplotlib backend (`print(matplotlib.get_backend())`): Qt5Agg\r\n * Python version: 3.6.5\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\r\nMatplotlib was installed with conda.","author":{"url":"https://github.com/t-makaro","@type":"Person","name":"t-makaro"},"datePublished":"2018-07-28T01:18:32.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/11787/matplotlib/issues/11787"}
| 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:106ca2f3-a9a7-7a03-ff0c-17169155614a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9DFC:48ECA:1AC8013:24EEE4A:6A5737B2 |
| html-safe-nonce | 38ce1920023d5606bee8b974a70bc7fb49d7d4ad9abd233102cd5cdb3b81228f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5REZDOjQ4RUNBOjFBQzgwMTM6MjRFRUU0QTo2QTU3MzdCMiIsInZpc2l0b3JfaWQiOiI5MjUyMjUwNjkzMjM5NTgxOTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5a2b9469e59670af9e439dbd10e088f64fb57498a62185fac9bb851dc65b1aad |
| hovercard-subject-tag | issue:345405201 |
| 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/11787/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b047321bc49c4e0051d8a78d30a8138d59715f50f0de1c9d5a014e3ba17d4ac9/matplotlib/matplotlib/issues/11787 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b047321bc49c4e0051d8a78d30a8138d59715f50f0de1c9d5a014e3ba17d4ac9/matplotlib/matplotlib/issues/11787 |
| og:image:alt | Bug report Bug summary Saving a gif using PillowWriter produces a gif that does not loop. Is there a way to make the gif loop endlessly using PillowWriter? Code for reproduction from matplotlib.ani... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | t-makaro |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4e7a7296a3830877cf21a6ad2a972c9e618a48915e03966cf0c53eb08e5aad98 |
| 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 | 2576d1f0198cf1588faf2edf27f1ed120903be10 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width