{"id":21086051,"url":"https://github.com/clberube/pydlc","last_synced_at":"2025-05-16T11:31:44.111Z","repository":{"id":62579909,"uuid":"374140211","full_name":"clberube/pydlc","owner":"clberube","description":"Simplified Python implementation of the Density Line Chart by Moritz \u0026 Fisher.","archived":false,"fork":false,"pushed_at":"2021-07-30T18:29:46.000Z","size":869,"stargazers_count":23,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-28T13:44:23.931Z","etag":null,"topics":["datavisualization","density-estimation","sequential-data","timeseries"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clberube.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-05T14:52:34.000Z","updated_at":"2025-04-10T21:42:34.000Z","dependencies_parsed_at":"2022-11-03T20:49:52.006Z","dependency_job_id":null,"html_url":"https://github.com/clberube/pydlc","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clberube%2Fpydlc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clberube%2Fpydlc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clberube%2Fpydlc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clberube%2Fpydlc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clberube","download_url":"https://codeload.github.com/clberube/pydlc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254521930,"owners_count":22085010,"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","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":["datavisualization","density-estimation","sequential-data","timeseries"],"created_at":"2024-11-19T20:42:40.936Z","updated_at":"2025-05-16T11:31:39.098Z","avatar_url":"https://github.com/clberube.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![DOI](https://zenodo.org/badge/374140211.svg)](https://zenodo.org/badge/latestdoi/374140211)\n\n\n# PyDLC - Density Line Charts with Python\nPython implementation of the Density Line Chart [(Moritz \u0026amp; Fisher, 2018)](https://arxiv.org/abs/1808.06019) to visualize time series collections.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./figures/example.png\" width=\"75%\"\u003e\n\u003c/p\u003e\n\n## Installation\n\n### Python Package Index\n\n```console\n$ pip install pydlc\n```\n\n### Requirements\n- [numpy](numpy.org/)\n- [matplotlib](matplotlib.org/)\n\n\n## Usage\n\n### Example\nThe following example shows how to import and use the `dense_lines` plotting function.\n```python\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom pydlc import dense_lines\n\n# Generate random synthetic time series\nx = np.linspace(0, 90, 25)\nys = []\nfor _ in range(10000):\n    ys.append(np.random.randn(1)*np.exp(-x/100))\n\n# Plot here\nfig, axs = plt.subplots(1, 2, figsize=(8, 3), sharey=True, sharex=True)\naxs[0].plot(x, np.array(ys).T, lw=1)  # this is slow and cluttered\naxs[0].set_title('Line Chart')\nim = dense_lines(ys, x=x, ax=axs[1], cmap='magma')  # this is fast and clean\naxs[1].set_title('Density Lines Chart')\nfig.colorbar(im)\nfig.tight_layout()\nplt.show()\n```\n\n### Arguments\n- ys (`list` of `1darray`): The lines to plot. Can also be\n    passed as a `2darray`.\n- x (`1darray`, optional): The x values corresponding to\n    the data passed with `ys`. If not provided, `range(0, len(ys))`\n    is used.\n- ax (`matplotlib axes`, optional): The axes to plot on. If not\n    provided a new figure will be created.\n- ny (`int`, optional): The vertical grid size. Higher values\n    yield a smoother density estimation. Default: 100.\n- y_pad (`float`, optional): The padding fraction to set the\n    grid limits past the data values. Must be greater than 0.\n    Default: 0.01.\n- normalize (`bool`, optional): Normalize the plot so the density\n    is between 0 and 1. Default: True.\n- **kwargs: Arbitrary keyword arguments to pass to `plt.imshow()`.\n\n## Limitations\n- All series to be included in the density estimation and passed in the `ys` argument must have the same length.\n- The vertical grid size can be adjusted with the `ny` parameter. Higher values of `ny` yield a smoother density visualization. However, the horizontal grid size is currently limited to the same size as the input sequences and there is no parameter to adjust it (yet). \n\n## Algorithm\nThis graphical abstract explains the algorithm ([source](https://idl.cs.washington.edu/papers/dense-lines/)).\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./figures/dense-lines.png\" width=\"75%\"\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclberube%2Fpydlc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclberube%2Fpydlc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclberube%2Fpydlc/lists"}