Python package colourmap generates an N unique colors from the specified input colormap.
Project description
colourmap
- Python package colourmap generates an N unique colors from the specified input colormap.
Contents
Installation
- Install colourmap from PyPI (recommended). colourmap is compatible with Python 3.6+ and runs on Linux, MacOS X and Windows.
- It is distributed under the MIT license.
Requirements
# This can be done manually but is also done automatically when pip installing colourmap.
pip install -r requirements
Quick Start
pip install colourmap
- Alternatively, install colourmap from the GitHub source:
git clone https://github.com/erdogant/colourmap.git
cd colourmap
python setup.py install
Import colourmap package
import colourmap as colourmap
Example:
N=10
# Create N colors
getcolors=colourmap.generate(N)
# With different cmap
getcolors=colourmap.generate(N, cmap='Set2')
# Create color for label
y=[1,1,2,2,3,1,2,3]
label_colors, colordict=colourmap.fromlist(y)
# With different cmap
label_colors, colordict=colourmap.fromlist(y, cmap='Set2')
# With different method
label_colors, colordict=colourmap.fromlist(y, cmap='Set2', method='seaborn')
# String as input labels
y=['1','1','2','2','3','1','2','3']
label_colors, colordict=colourmap.fromlist(y)
# With different cmap
label_colors, colordict=colourmap.fromlist(y, cmap='Set2')
# With different method
label_colors, colordict=colourmap.fromlist(y, cmap='Set2', method='seaborn')
Citation
Please cite colourmap in your publications if this is useful for your research. Here is an example BibTeX entry:
@misc{erdogant2019colourmap,
title={colourmap},
author={Erdogan Taskesen},
year={2019},
howpublished={\url{https://github.com/erdogant/colourmap}},
}
Maintainers
- Erdogan Taskesen, github: erdogant
Contribute
- Contributions are welcome.
Licence
See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
colourmap-0.1.0.tar.gz
(3.6 kB
view details)
Built Distribution
File details
Details for the file colourmap-0.1.0.tar.gz
.
File metadata
- Download URL: colourmap-0.1.0.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1078a4feda370405dec82e193b5227d087a9163f9790565fa7a51afe4a8f2acc |
|
MD5 | c3ed3f53ddd9e8fde92fbd496979ea06 |
|
BLAKE2b-256 | 8d638647f570a7b2d785356a903cdb205d62292c6d4da7a229b662e6aeabe6be |
File details
Details for the file colourmap-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: colourmap-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75ad0c9d5daaea686aa5465e785c9ea60eeb41305d21ff275eca8bbdc81cee84 |
|
MD5 | 3e9d806b57f95a46cb994e4f27f42b9c |
|
BLAKE2b-256 | f23b05162f7f91d2fd8db20b183ded53f7d8bc8747339c07096cd7453869e789 |