{"id":13870026,"url":"https://github.com/dhaitz/mplcyberpunk","last_synced_at":"2025-05-13T21:08:05.198Z","repository":{"id":43183504,"uuid":"251089784","full_name":"dhaitz/mplcyberpunk","owner":"dhaitz","description":"\"Cyberpunk style\" for matplotlib plots","archived":false,"fork":false,"pushed_at":"2025-02-26T13:35:51.000Z","size":3018,"stargazers_count":1752,"open_issues_count":12,"forks_count":75,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-04-29T13:12:27.060Z","etag":null,"topics":["dataviz","matplotlib","plotting","python","visualization"],"latest_commit_sha":null,"homepage":"","language":"Python","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/dhaitz.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}},"created_at":"2020-03-29T17:22:58.000Z","updated_at":"2025-04-25T06:00:14.000Z","dependencies_parsed_at":"2024-06-18T16:50:26.600Z","dependency_job_id":"d70bd7d2-871a-4404-bf1e-469fb3342d08","html_url":"https://github.com/dhaitz/mplcyberpunk","commit_stats":{"total_commits":96,"total_committers":9,"mean_commits":"10.666666666666666","dds":"0.30208333333333337","last_synced_commit":"c2c9b5dba40a21fd3f02ea5674d16ab6925a0cb9"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhaitz%2Fmplcyberpunk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhaitz%2Fmplcyberpunk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhaitz%2Fmplcyberpunk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhaitz%2Fmplcyberpunk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dhaitz","download_url":"https://codeload.github.com/dhaitz/mplcyberpunk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254028936,"owners_count":22002282,"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":["dataviz","matplotlib","plotting","python","visualization"],"created_at":"2024-08-05T20:01:25.946Z","updated_at":"2025-05-13T21:08:00.174Z","avatar_url":"https://github.com/dhaitz.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# mplcyberpunk\n\n\n[![Latest PyPI version](https://img.shields.io/pypi/v/mplcyberpunk.svg)](https://pypi.python.org/pypi/mplcyberpunk)\n![example workflow](https://github.com/dhaitz/mplcyberpunk/actions/workflows/test-deploy.yml/badge.svg)\n![Python 3.12](https://img.shields.io/badge/python-3.12-blue.svg)\n\n\nA Python package on top of `matplotlib` to create 'cyberpunk' style plots with 3 additional lines of code.\n\n![](img/demo.png)\n\n## Installation\n\n    pip install mplcyberpunk\n\n## Usage\n\nAfter importing the package, the _cyberpunk_ stylesheet (dark background etc.) is available via `plt.style.use`.\nThe line glow and 'underglow' effects are added via calling `add_glow_effects`:\n\n```python\nimport matplotlib.pyplot as plt\nimport mplcyberpunk\n\nplt.style.use(\"cyberpunk\")\n\nplt.plot([1, 3, 9, 5, 2, 1, 1], marker='o')\nplt.plot([4, 5, 5, 7, 9, 8, 6], marker='o')\n\nmplcyberpunk.add_glow_effects()\n\nplt.show()\n```\n\nResult:\n\n![](img/demo.png)\n\nThis effect is currently only implemented for lines.\n\nThe individual steps are described [here](https://matplotlib.org/matplotblog/posts/matplotlib-cyberpunk-style/) in more detail.\n\n\n#### Add effects individually\n\nInstead of `add_glow_effects`, you can add the line glow and underglow effects separately:\n\n    mplcyberpunk.make_lines_glow()\n    mplcyberpunk.add_underglow()\n\n\nYou can also add the effect to a specific axis object explicitly:\n\n    fig, ax = plt.subplots()\n    ...\n    mplcyberpunk.make_lines_glow(ax)\n\n![](img/sin.png)\n\n\nTo activate the glow effect only for specific lines, pass a Line2D object or a list of Line2Ds to `make_lines_glow`.\n\n\n#### Gradient glow\n\nGradient underglow effect can be added with\n\n    mplcyberpunk.add_glow_effects(gradient_fill=True)\n\nor independently of line glow with\n\n    mplcyberpunk.add_gradient_fill(alpha_gradientglow=0.5)\n\n`add_gradient_fill` takes a `gradient_start` argument for different gradient starting values:\n\n ![gradient_start](img/gradient_start.png)\n\n\n#### Different glow configurations:\n![underglows](img/underglows.png)\n\n\n#### Scatter plots\n\nGlow effect can be added to scatter plots via `mplcyberpunk.make_scatter_glow()`:\n\n![](img/scatter.png)\n\n#### Colormap\n\nThe default colormap is `cool`:\n\n![colormap](img/colormap.png)\n\nOthers:\n\n\n![colormaps](img/colormaps.png)\n\n\n#### Bar charts\n\n```python\nimport matplotlib.pyplot as plt\nimport mplcyberpunk\n\nplt.style.use('cyberpunk')\n\ncategories = ['A', 'B', 'C', 'D', 'E']\nvalues = [25, 67, 19, 45, 10]\ncolors = [\"C0\", \"C1\", \"C2\", \"C3\", \"C4\"]\n\nbars = plt.bar(categories, values, color=colors, zorder=2)\n\nmplcyberpunk.add_bar_gradient(bars=bars)\n\nplt.show()\n```\n\n![colormap](img/gradient_bars.png)\n\n\n\n## Gallery\n![europe](img/europe.png)\n![world](img/world.png)\n\n![gradient-fill_1](img/gradient-fill_1.png)\n![gradient-fill_2](img/gradient-fill_2.png)\n\n\nSome images can be bought as posters [here](https://displate.com/sr-artworks/dhaitz).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhaitz%2Fmplcyberpunk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdhaitz%2Fmplcyberpunk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhaitz%2Fmplcyberpunk/lists"}