{"id":31692553,"url":"https://github.com/mthiboust/colormap2d","last_synced_at":"2025-10-08T14:54:05.378Z","repository":{"id":203838940,"uuid":"710367488","full_name":"mthiboust/colormap2d","owner":"mthiboust","description":"Colormap for 2D vectors","archived":false,"fork":false,"pushed_at":"2023-11-15T21:43:37.000Z","size":127,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-30T09:08:48.682Z","etag":null,"topics":["colormap","data-visualization","plotting"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mthiboust.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,"governance":null}},"created_at":"2023-10-26T14:54:14.000Z","updated_at":"2023-10-30T08:54:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"edf75d7b-b377-4cfb-8438-b805b6ddc2d5","html_url":"https://github.com/mthiboust/colormap2d","commit_stats":null,"previous_names":["mthiboust/colormap2d"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/mthiboust/colormap2d","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthiboust%2Fcolormap2d","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthiboust%2Fcolormap2d/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthiboust%2Fcolormap2d/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthiboust%2Fcolormap2d/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mthiboust","download_url":"https://codeload.github.com/mthiboust/colormap2d/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthiboust%2Fcolormap2d/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278963840,"owners_count":26076543,"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-08T02:00:06.501Z","response_time":56,"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":["colormap","data-visualization","plotting"],"created_at":"2025-10-08T14:53:56.261Z","updated_at":"2025-10-08T14:54:05.373Z","avatar_url":"https://github.com/mthiboust.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 2D Colormap \n\n`matplotlib` provides [many colormaps](https://matplotlib.org/stable/users/explain/colors/colormaps.html) that map scalars to colors. However, it does not provide such colormaps for 2D vectors. Representing 2D vectors as colors may be helpful when dealing with complex numbers or 2D coordinates. This library provides 2 colormaps for this purpose including a cyclic one.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/mthiboust/colormap2d/main/docs/pinwheel_colormap.png\" width=\"350\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/mthiboust/colormap2d/main/docs/cyclic_pinwheel_colormap.png\" width=\"350\"\u003e\n\u003c/p\u003e\n\n## Installation\n\n```shell\npip install colormap2d\n```\n\n## Usage \n\n```python\nimport numpy as np\nimport colormap2d\n\nsome_2d_vectors = np.random.rand(5, 2) \n\n# Random 2D vectors between 0 and 1:\n# array([[0.91270668, 0.60020465],\n#        [0.51569033, 0.79642031],\n#        [0.36533928, 0.31441287],\n#        [0.41346207, 0.45163162],\n#        [0.99135696, 0.05691322]])\n\ncolormap2d.pinwheel(some_2d_vectors)\n\n# RGBA float values between 0 and 1 (default)\n# array([[0.69019608, 0.6627451 , 0.24705882, 1.        ],\n#        [0.25490196, 0.74509804, 0.82352941, 1.        ],\n#        [0.41960784, 0.2       , 0.79215686, 1.        ],\n#        [0.18823529, 0.29803922, 0.20392157, 1.        ],\n#        [0.24705882, 0.24705882, 0.66666667, 1.        ]])\n\ncolormap2d.pinwheel(some_2d_vectors, mode=\"RGB\", dtype=np.uint8)\n# RGB integers between 0 and 255:\n# array([[166, 179,  50],\n#        [ 50,  66,  94],\n#        [ 63,  98, 212],\n#        [ 66,  66, 196],\n#        [222, 199, 169]], dtype=uint8)\n\n```\n\n## Behind the scene\n\nThe colormap data has been created using Self-Organizing Maps. \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmthiboust%2Fcolormap2d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmthiboust%2Fcolormap2d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmthiboust%2Fcolormap2d/lists"}