{"id":17153689,"url":"https://github.com/ziofil/live_plot","last_synced_at":"2025-10-12T09:32:47.986Z","repository":{"id":71894855,"uuid":"151831744","full_name":"ziofil/live_plot","owner":"ziofil","description":"A jupyter-lab function for updating a plot dynamically in-place.","archived":false,"fork":false,"pushed_at":"2018-10-06T11:37:48.000Z","size":2747,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-12T09:32:08.342Z","etag":null,"topics":["dynamic-plots","jupyter-notebook","jupyterlab","matplotlib","plotting","python"],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ziofil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-10-06T11:07:12.000Z","updated_at":"2022-12-08T23:51:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"acc7078f-e7de-4ed3-a0e9-e7e71d44b996","html_url":"https://github.com/ziofil/live_plot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ziofil/live_plot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziofil%2Flive_plot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziofil%2Flive_plot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziofil%2Flive_plot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziofil%2Flive_plot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ziofil","download_url":"https://codeload.github.com/ziofil/live_plot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziofil%2Flive_plot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010936,"owners_count":26084837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dynamic-plots","jupyter-notebook","jupyterlab","matplotlib","plotting","python"],"created_at":"2024-10-14T21:47:00.207Z","updated_at":"2025-10-12T09:32:47.980Z","avatar_url":"https://github.com/ziofil.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# live_plot\nA jupyter-lab function for updating a plot dynamically in-place.\n\n### Disclaimer\nLive plot covers only `pyplot.plot` (for now) and requires some explicit imports. It works with jupyter_lab on my mac, I haven't tested it in any other environemnt. You are welcome to create pull requests.\n\n\nThe working principle is simple: create a loop in which you populate a dictionary with the data you want to plot. Use the keys to label different datasets. Still within the loop, pass it to live_plot, sit back and watch.\n\n### Example\nAfter importing the required libraries and defining the `live_plot` function (see example notebook), populate the dictionary in a loop. Better still, use a `defaultdict` to return an empty list the first time you use a new key:\n\n```python\nimport numpy as np\nfrom collections import defaultdict\n\ndata = defaultdict(list)\n\nfor i in range(100):\n    data['foo'].append(np.sin(i/10) + 0.1*np.random.random())\n    data['bar'].append(np.random.random()+0.3)\n    live_plot(data)\n```\n\nyou should observe this in the cell output (the framerate will depend on the speed of the loop)\n\n![live plot animation](https://github.com/ziofil/live_plot/blob/master/animation.gif)\n\nMake sure you create a few cells below the animation, otherwise the view snaps back into place and it's a bit annoying.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziofil%2Flive_plot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fziofil%2Flive_plot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziofil%2Flive_plot/lists"}